Error handling#
All server-side errors raised by the Tonita Python library will inherit from tonita.errors.TonitaError
. We provide the following errors for isolating different failure cases:
tonita.errors.TonitaBadRequestError
: Indicates a malformed request provided by the caller. Corresponds to HTTP error code 400 (Bad Request).tonita.errors.TonitaUnauthorizedError
: Indicates an unauthorized request because of an invalid API key. Corresponds to HTTP error code 401 (Unauthorized).tonita.errors.TonitaInternalServerError
: Indicates an error internal to Tonita. Corresponds to HTTP error code 500 (Internal Server Error).tonita.errors.TonitaNotImplementedError
: The functionality is not implemented. Corresponds to HTTP error code 501 (Not Implemented).