exceptions#
- exception litestar.exceptions.ClientException#
Bases:
HTTPException
Client error.
- exception litestar.exceptions.DTOFactoryException#
Bases:
LitestarException
Base DTO exception type.
- exception litestar.exceptions.HTTPException#
Bases:
LitestarException
Base exception for HTTP error responses.
These exceptions carry information to construct an HTTP response.
- exception litestar.exceptions.ImproperlyConfiguredException#
Bases:
HTTPException
,ValueError
Application has improper configuration.
- exception litestar.exceptions.InternalServerException#
Bases:
HTTPException
Server encountered an unexpected condition that prevented it from fulfilling the request.
- exception litestar.exceptions.InvalidAnnotationException#
Bases:
DTOFactoryException
Unexpected DTO type argument.
- exception litestar.exceptions.LitestarException#
Bases:
Exception
Base exception class from which all Litestar exceptions inherit.
- exception litestar.exceptions.LitestarWarning#
Bases:
UserWarning
Base class for Litestar warnings
- exception litestar.exceptions.MethodNotAllowedException#
Bases:
ClientException
Server knows the request method, but the target resource doesn’t support this method.
- exception litestar.exceptions.MissingDependencyException#
Bases:
LitestarException
,ImportError
Missing optional dependency.
This exception is raised only when a module depends on a dependency that has not been installed.
- exception litestar.exceptions.NoRouteMatchFoundException#
Bases:
InternalServerException
A route with the given name could not be found.
- exception litestar.exceptions.NotAuthorizedException#
Bases:
ClientException
Request lacks valid authentication credentials for the requested resource.
- exception litestar.exceptions.NotFoundException#
Bases:
ClientException
,ValueError
Cannot find the requested resource.
- exception litestar.exceptions.PermissionDeniedException#
Bases:
ClientException
Request understood, but not authorized.
- exception litestar.exceptions.SerializationException#
Bases:
LitestarException
Encoding or decoding of an object failed.
Bases:
InternalServerException
Server is not ready to handle the request.
Exception status code.
- exception litestar.exceptions.TemplateNotFoundException#
Bases:
InternalServerException
Referenced template could not be found.
- exception litestar.exceptions.TooManyRequestsException#
Bases:
ClientException
Request limits have been exceeded.
- exception litestar.exceptions.ValidationException#
Bases:
ClientException
,ValueError
Client data validation error.
- exception litestar.exceptions.WebSocketDisconnect#
Bases:
WebSocketException
Exception class for websocket disconnect events.
- exception litestar.exceptions.WebSocketException#
Bases:
LitestarException
Exception class for websocket related events.
- class litestar.exceptions.responses.ExceptionResponseContent#
Bases:
object
Represent the contents of an exception-response.
- litestar.exceptions.responses.create_exception_response(request: Request[Any, Any, Any], exc: Exception) Response #
Construct a response from an exception.
Notes
For instances of
HTTPException
or other exception classes that have astatus_code
attribute (e.g. Starlette exceptions), the status code is drawn from the exception, otherwise response status isHTTP_500_INTERNAL_SERVER_ERROR
.