mantelo.exceptions#

Exceptions#

ManteloException

Base exception for all exceptions raised by the Mantelo library.

AuthenticationException

Exception raised when the authentication request fails with a 401 Unauthorized status code.

HttpException

Exception raised on HTTP errors when talking to the Keycloak Admin API.

HttpClientError

Called when the server tells us there was a client error (4xx).

HttpNotFound

Called when the server sends a 404 error.

HttpServerError

Called when the server tells us there was a server error (5xx).

SerializerNoAvailable

The serializer for the content type is not available.

Module Contents#

exception mantelo.exceptions.ManteloException#

Bases: Exception

Base exception for all exceptions raised by the Mantelo library.

exception mantelo.exceptions.AuthenticationException#

Bases: ManteloException

Exception raised when the authentication request fails with a 401 Unauthorized status code.

error: str#

The error message from Keycloak.

error_description: str#

The error description from Keycloak.

response: requests.Response#

The response object from the server.

exception mantelo.exceptions.HttpException#

Bases: ManteloException

Exception raised on HTTP errors when talking to the Keycloak Admin API.

status_code: int#

The HTTP status code.

json: dict#

The JSON response from the server, or an empty JSON if the body is not JSON.

url: str#

The URL that was requested.

response: requests.Response#

The response object from the server.

classmethod from_response(response: requests.Response) HttpException#
exception mantelo.exceptions.HttpClientError#

Bases: HttpException

Called when the server tells us there was a client error (4xx).

exception mantelo.exceptions.HttpNotFound#

Bases: HttpClientError

Called when the server sends a 404 error.

exception mantelo.exceptions.HttpServerError#

Bases: HttpException

Called when the server tells us there was a server error (5xx).

exception mantelo.exceptions.SerializerNoAvailable#

Bases: ManteloException

The serializer for the content type is not available.