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: Optional[str] = None, details: Optional[Dict[str, Any]] = None)[source]

Bases: tornado.web.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: Optional[str] = None, details: Optional[Dict[str, Any]] = None)[source]

Bases: inmanta.protocol.exceptions.BaseHttpException

An exception raised when access is denied (403)

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

Bases: inmanta.protocol.exceptions.BaseHttpException

An exception raised when access to this resource is unauthorized

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

Bases: inmanta.protocol.exceptions.BaseHttpException

This exception is raised for a malformed request

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

Bases: inmanta.protocol.exceptions.BaseHttpException

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

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

Bases: inmanta.protocol.exceptions.BaseHttpException

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

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

Bases: inmanta.protocol.exceptions.BaseHttpException

An unexpected error occurred in the server

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

Bases: inmanta.protocol.exceptions.BaseHttpException

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