repo_helper_github.exceptions

Custom exception types.

New in version 0.7.0.

Exceptions:

GitHubException

Base class for exceptions raised by repo-helper-github.

ErrorCreatingRepository(username, repository)

Exception raised when a repository cannot be created.

NoSuchRepository(username, repository[, org])

Exception raised when a repository does not exist.

NoSuchBranch(username, repository, branch)

Exception raised when a branch does not exist.

BadUsername(msg, username)

Raised when there is a problem with the username configured in repo_helper.yml.

OrganizationError(msg, organization)

Raised when there is a problem with the organization configured in repo_helper.yml.

Classes:

TracebackHandler([exception])

consolekit.tracebacks.TracebackHandler which handles subclasses of GitHubException.

exception GitHubException[source]

Bases: ValueError

Base class for exceptions raised by repo-helper-github.

exception ErrorCreatingRepository(username, repository, org=False)[source]

Bases: repo_helper_github.exceptions.GitHubException

Exception raised when a repository cannot be created.

Parameters
  • username (str) – The username of the account the repository should belong to.

  • repository (str) – The name of the repository which doesn’t exist.

  • org (bool) – Whether the username is a GitHub organization. Default False.

username

Type:    str

The username of the account the repository was being created in.

repository

Type:    str

The name of the repository being created.

org

Type:    bool

Whether the username is a GitHub organization.

property full_name

The full name (user/name) of the repository being created.

Return type

str

exception NoSuchRepository(username, repository, org=False)[source]

Bases: repo_helper_github.exceptions.GitHubException

Exception raised when a repository does not exist.

Parameters
  • username (str) – The username of the account the repository should belong to.

  • repository (str) – The name of the repository which doesn’t exist.

  • org (bool) – Whether the username is a GitHub organization. Default False.

username

Type:    str

The username of the account the repository should belong to.

repository

Type:    str

The name of the repository which doesn’t exist.

org

Type:    bool

Whether the username is a GitHub organization.

property full_name

The full name (user/name) of the repository which doesn’t exist.

Return type

str

exception NoSuchBranch(username, repository, branch)[source]

Bases: repo_helper_github.exceptions.GitHubException

Exception raised when a branch does not exist.

Parameters
  • username (str) – The username of the account the repository belongs to.

  • repository (str) – The name of the repository.

  • branch (str) – The name of the branch.

username

Type:    str

The username of the account the repository belongs to.

repository

Type:    str

The name of the repository.

branch

Type:    str

The name of the branch.

exception BadUsername(msg, username)[source]

Bases: repo_helper_github.exceptions.GitHubException

Raised when there is a problem with the username configured in repo_helper.yml.

Parameters

username (str)

username

Type:    str

The problem username

exception OrganizationError(msg, organization)[source]

Bases: repo_helper_github.exceptions.GitHubException

Raised when there is a problem with the organization configured in repo_helper.yml.

Parameters

organization (str)

organization

Type:    str

The problem organization

class TracebackHandler(exception=Abort())[source]

Bases: TracebackHandler

consolekit.tracebacks.TracebackHandler which handles subclasses of GitHubException.