Jump to >

reviewboard.hostingsvcs.errors

exception HostingServiceError(message, http_code=None, help_link=None, help_link_text=None)[source]

Bases: exceptions.Exception

Base class for errors related to a hosting service.

__init__(message, http_code=None, help_link=None, help_link_text=None)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

exception HostingServiceAPIError(msg=None, http_code=None, rsp=None)[source]

Bases: reviewboard.hostingsvcs.errors.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.

http_code

int – The HTTP code for the error.

rsp

object – The parsed payload for the error, if available.

__init__(msg=None, http_code=None, rsp=None)[source]

Initialize the error.

Parameters:
  • msg (unicode, optional) – The error message from the service.
  • http_code (int, optional) – The HTTP code for the error.
  • rsp (object, optional) – The parsed payload for the error.
exception RepositoryError(message, http_code=None, help_link=None, help_link_text=None)[source]

Bases: reviewboard.hostingsvcs.errors.HostingServiceError

An error validating, configuring or using a repository.

exception AuthorizationError(message, http_code=None, help_link=None, help_link_text=None)[source]

Bases: reviewboard.hostingsvcs.errors.HostingServiceError

exception TwoFactorAuthCodeRequiredError(message, http_code=None, help_link=None, help_link_text=None)[source]

Bases: reviewboard.hostingsvcs.errors.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.

exception InvalidPlanError(plan)[source]

Bases: reviewboard.hostingsvcs.errors.HostingServiceError

Indicates an invalid plan name was used.

__init__(plan)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

exception SSHKeyAssociationError(message, http_code=None, help_link=None, help_link_text=None)[source]

Bases: reviewboard.hostingsvcs.errors.HostingServiceError