Exceptions

For more details about Compiler Exceptions, see Compiler exceptions

HTTP Exceptions

HTTP Exceptions are raised when a server request can’t be completed successfully. Each exception specifies what the HTTP status code of the response should be. By using the correct exception type (and a descriptive error message) the clients can get more information about what went wrong.

class inmanta.protocol.exceptions.BaseHttpException(status_code: int = 500, message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: HTTPError

A base exception for errors in the server.

Classes which extend from the BaseHttpException class cannot have mandatory arguments in their constructor. This is required to determine the status_code of the exception in inmanta.protocol.common.MethodProperties._get_http_status_code_for_exception()

class inmanta.protocol.exceptions.Forbidden(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

An exception raised when access is denied (403)

class inmanta.protocol.exceptions.UnauthorizedException(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

An exception raised when access to this resource is unauthorized

class inmanta.protocol.exceptions.BadRequest(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

This exception is raised for a malformed request

class inmanta.protocol.exceptions.NotFound(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

This exception is used to indicate that a request or reference resource was not found.

class inmanta.protocol.exceptions.Conflict(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

This exception is used to indicate that a request conflicts with the current state of the resource.

class inmanta.protocol.exceptions.ServerError(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

An unexpected error occurred in the server

class inmanta.protocol.exceptions.ShutdownInProgress(message: str | None = None, details: dict[str, Any] | None = None)[source]

Bases: BaseHttpException

This request can not be fulfilled because the server is going down