exceptions¶
BadRequest
¶
Bases: OptimadeHTTPException
400 Bad Request
Source code in optimade/exceptions.py
57 58 59 60 61 |
|
Forbidden
¶
Bases: OptimadeHTTPException
403 Forbidden
Source code in optimade/exceptions.py
71 72 73 74 75 |
|
InternalServerError
¶
Bases: OptimadeHTTPException
500 Internal Server Error
Source code in optimade/exceptions.py
92 93 94 95 96 |
|
NotFound
¶
Bases: OptimadeHTTPException
404 Not Found
Source code in optimade/exceptions.py
78 79 80 81 82 |
|
NotImplementedResponse
¶
Bases: OptimadeHTTPException
501 Not Implemented
Source code in optimade/exceptions.py
99 100 101 102 103 |
|
OptimadeHTTPException
¶
Bases: Exception
, ABC
This abstract class can be subclassed to define HTTP responses with the desired status codes, and detailed error strings to represent in the JSON:API error response.
This class closely follows the starlette.HTTPException
without
requiring it as a dependency, so that such errors can also be
raised from within client code.
Attributes:
Name | Type | Description |
---|---|---|
status_code |
int
|
The HTTP status code accompanying this exception. |
title |
str
|
A descriptive title for this exception. |
detail |
Optional[str]
|
An optional string containing the details of the error. |
Source code in optimade/exceptions.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
UnprocessableEntity
¶
Bases: OptimadeHTTPException
422 Unprocessable Entity
Source code in optimade/exceptions.py
85 86 87 88 89 |
|
VersionNotSupported
¶
Bases: OptimadeHTTPException
553 Version Not Supported
Source code in optimade/exceptions.py
64 65 66 67 68 |
|