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:

  1. tonita.errors.TonitaBadRequestError: Indicates a malformed request provided by the caller. Corresponds to HTTP error code 400 (Bad Request).

  2. tonita.errors.TonitaUnauthorizedError: Indicates an unauthorized request because of an invalid API key. Corresponds to HTTP error code 401 (Unauthorized).

  3. tonita.errors.TonitaInternalServerError: Indicates an error internal to Tonita. Corresponds to HTTP error code 500 (Internal Server Error).

  4. tonita.errors.TonitaNotImplementedError: The functionality is not implemented. Corresponds to HTTP error code 501 (Not Implemented).