reviewboard.hostingsvcs.errors¶
Errors for hosting service operations.
- exception HostingServiceError(message: str, http_code: Optional[int] = None, help_link: Optional[str] = None, help_link_text: Optional[str] = None)[source]¶
Bases:
Exception
Base class for errors related to a hosting service.
- __init__(message: str, http_code: Optional[int] = None, help_link: Optional[str] = None, help_link_text: Optional[str] = None) None [source]¶
Initialize the error.
- Parameters:
message (
str
) – The error message.http_code (
int
, optional) – An optional HTTP status code for the error.help_link (
str
, optional) – An optional URL for further information on the error.help_link_text (
str
, optional) –A label for the optional URL for further information on the error.
This must be provided if
help_link
is set.
- Raises:
ValueError –
help_link
was provided buthelp_link_text
was not.
- help_link_text: Optional[str]¶
A label for the optional URL for further information on the error.
This will always be provided if
help_link
is set.
- __annotations__ = {'help_link': 'Optional[str]', 'help_link_text': 'Optional[str]', 'http_code': 'Optional[int]'}¶
- exception HostingServiceAPIError(msg: Optional[str] = None, http_code: Optional[int] = None, rsp: Optional[Dict] = None)[source]¶
Bases:
HostingServiceError
An API error from a hosting service.
This represents an error from the hosting service’s API. It contains the error message, HTTP code, and the parsed response payload.
HostingServiceAPIError instances can be further turned into other error types, or raised directly, if the error message is suitable for display.
- __init__(msg: Optional[str] = None, http_code: Optional[int] = None, rsp: Optional[Dict] = None) None [source]¶
Initialize the error.
- __annotations__ = {'help_link': 'Optional[str]', 'help_link_text': 'Optional[str]', 'http_code': 'Optional[int]', 'rsp': 'Optional[Dict]'}¶
- exception RepositoryError(message: str, http_code: Optional[int] = None, help_link: Optional[str] = None, help_link_text: Optional[str] = None)[source]¶
Bases:
HostingServiceError
An error validating, configuring or using a repository.
- __annotations__ = {}¶
- exception AuthorizationError(message: str, http_code: Optional[int] = None, help_link: Optional[str] = None, help_link_text: Optional[str] = None)[source]¶
Bases:
HostingServiceError
An error authorizing an account with a hosting service.
- __annotations__ = {}¶
- exception MissingHostingServiceError(hosting_service_id: str, repository: Optional[str] = None)[source]¶
Bases:
HostingServiceError
Indicates that the hosting service could not be loaded.
- __annotations__ = {'hosting_service_id': 'str'}¶
- exception TwoFactorAuthCodeRequiredError(message: str, http_code: Optional[int] = None, help_link: Optional[str] = None, help_link_text: Optional[str] = None)[source]¶
Bases:
AuthorizationError
Response from a service indicating a two-factor auth code is required.
Some services will indicate, after an authorization attempt, that a two-factor authorization code must be provided to complete authorization. Services can raise this error, along with a helpful message, to inform the user and the repository form of this.
- __annotations__ = {}¶
- exception InvalidPlanError(plan: str)[source]¶
Bases:
HostingServiceError
Indicates an invalid plan name was used.
- __annotations__ = {}¶