exceptions
Definition of extra HTTP exceptions that aren't included in Starlite.
Also, defines functions that translate service and repository exceptions into HTTP exceptions.
ConflictException ¶
ForbiddenException ¶
after_exception_hook_handler ¶
repository_exception_to_http_response ¶
Transform repository exceptions to HTTP exceptions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
The request that experienced the exception. |
required |
exc |
RepositoryException
|
Exception raised during handling of the request. |
required |
Returns:
| Type | Description |
|---|---|
Response
|
Exception response appropriate to the type of original exception. |
service_exception_to_http_response ¶
Transform service exceptions to HTTP exceptions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
The request that experienced the exception. |
required |
exc |
ServiceException
|
Exception raised during handling of the request. |
required |
Returns:
| Type | Description |
|---|---|
Response
|
Exception response appropriate to the type of original exception. |