exceptions#
- exception litestar.exceptions.ClientException#
Bases:
HTTPExceptionClient error.
- exception litestar.exceptions.DTOFactoryException#
Bases:
LitestarExceptionBase DTO exception type.
- exception litestar.exceptions.HTTPException#
Bases:
LitestarExceptionBase exception for HTTP error responses.
These exceptions carry information to construct an HTTP response.
- exception litestar.exceptions.ImproperlyConfiguredException#
Bases:
HTTPException,ValueErrorApplication has improper configuration.
- exception litestar.exceptions.InternalServerException#
Bases:
HTTPExceptionServer encountered an unexpected condition that prevented it from fulfilling the request.
- exception litestar.exceptions.InvalidAnnotationException#
Bases:
DTOFactoryExceptionUnexpected DTO type argument.
- exception litestar.exceptions.LitestarException#
Bases:
ExceptionBase exception class from which all Litestar exceptions inherit.
- exception litestar.exceptions.LitestarWarning#
Bases:
UserWarningBase class for Litestar warnings
- exception litestar.exceptions.MethodNotAllowedException#
Bases:
ClientExceptionServer knows the request method, but the target resource doesn’t support this method.
- exception litestar.exceptions.MissingDependencyException#
Bases:
LitestarException,ImportErrorMissing optional dependency.
This exception is raised only when a module depends on a dependency that has not been installed.
- exception litestar.exceptions.NoRouteMatchFoundException#
Bases:
InternalServerExceptionA route with the given name could not be found.
- exception litestar.exceptions.NotAuthorizedException#
Bases:
ClientExceptionRequest lacks valid authentication credentials for the requested resource.
- exception litestar.exceptions.NotFoundException#
Bases:
ClientException,ValueErrorCannot find the requested resource.
- exception litestar.exceptions.PermissionDeniedException#
Bases:
ClientExceptionRequest understood, but not authorized.
- exception litestar.exceptions.SerializationException#
Bases:
LitestarExceptionEncoding or decoding of an object failed.
Bases:
InternalServerExceptionServer is not ready to handle the request.
Exception status code.
- exception litestar.exceptions.TemplateNotFoundException#
Bases:
InternalServerExceptionReferenced template could not be found.
- exception litestar.exceptions.TooManyRequestsException#
Bases:
ClientExceptionRequest limits have been exceeded.
- exception litestar.exceptions.ValidationException#
Bases:
ClientException,ValueErrorClient data validation error.
- exception litestar.exceptions.WebSocketDisconnect#
Bases:
WebSocketExceptionException class for websocket disconnect events.
- exception litestar.exceptions.WebSocketException#
Bases:
LitestarExceptionException class for websocket related events.
- class litestar.exceptions.responses.ExceptionResponseContent#
Bases:
objectRepresent the contents of an exception-response.
- litestar.exceptions.responses.create_debug_response(request: Request, exc: Exception) Response#
Create a debug response from an exception.
- litestar.exceptions.responses.create_exception_response(request: Request[Any, Any, Any], exc: Exception) Response#
Construct a response from an exception.
Notes
For instances of
HTTPExceptionor other exception classes that have astatus_codeattribute (e.g. Starlette exceptions), the status code is drawn from the exception, otherwise response status isHTTP_500_INTERNAL_SERVER_ERROR.