exceptions¶
Application exceptions
Litestar-saqlalchemy exception types.
Also, defines functions that translate service and repository exceptions into HTTP exceptions.
- exception app.lib.exceptions.ApplicationError(*args: Any, detail: str = '')[source]¶
Bases:
ExceptionBase exception type for the lib’s custom exception types.
Initialize
AdvancedAlchemyException.- Parameters:
- exception app.lib.exceptions.AuthorizationError(*args: Any, detail: str = '')[source]¶
Bases:
ApplicationClientErrorA user tried to do something they shouldn’t have.
Initialize
AdvancedAlchemyException.
- exception app.lib.exceptions.HealthCheckConfigurationError(*args: Any, detail: str = '')[source]¶
Bases:
ApplicationErrorAn error occurred while registering an health check.
Initialize
AdvancedAlchemyException.
- async app.lib.exceptions.after_exception_hook_handler(exc: Exception, _scope: Scope) None[source]¶
Binds exc_info key with exception instance as value to structlog context vars.
This must be a coroutine so that it is not wrapped in a thread where we’ll lose context.
- Parameters:
exc – the exception that was raised.
_scope – scope of the request