Exceptions

Note

The exception hierarchy of this library is illustrated as so-

  • BasePistonError
    • InternalError
      • MissingDataError

    • ServerError
      • BadRequestError

      • TooManyRequestsError

      • InternalServerError

      • NotFoundError

      • UnexpectedStatusError

class ultra_piston.errors.BasePistonError

The base exception to all ultra-piston errors.

class ultra_piston.errors.InternalError

Errors raised internally by the wrapper.

class ultra_piston.errors.ServerError(*args, endpoint=None, status_code)

Raised for server responses that return a non-2xx (error) HTTP status code.

Attributes:
endpoint
The endpoint URL.
status_code
The status code of the server response.
Parameters:
class ultra_piston.errors.MissingDataError

Raised when the required data is not set or is missing.

class ultra_piston.errors.BadRequestError(endpoint=None, message=None)

Raised due to passing invalid arguments.

Attributes:
endpoint
The endpoint URL.
status_code
The status code of the server response.
Parameters:
class ultra_piston.errors.TooManyRequestsError(endpoint=None, message=None)

Raised due to sending too many requests in a short interval.

Attributes:
endpoint
The endpoint URL.
status_code
The status code of the server response.
Parameters:
class ultra_piston.errors.InternalServerError(endpoint=None, message=None)

Raised due to an issue with the server.

Attributes:
endpoint
The endpoint URL.
status_code
The status code of the server response.
Parameters:
class ultra_piston.errors.NotFoundError(endpoint=None, message=None)

Raised when trying to access an unkown endpoint.

Attributes:
endpointOptional[str]
The endpoint URL.
status_codeint
The status code of the server response.
Parameters:
class ultra_piston.errors.UnexpectedStatusError(status_code, endpoint=None, message=None)

Raised for any unkown response status code (non-2xx).

Attributes:
endpointOptional[str]
The endpoint URL.
status_codeint
The status code of the server response.
Parameters: