HTTPException
class¶
This is the reference for the main object HTTPException
that contains all the parameters,
attributes and functions.
esmerald.HTTPException ¶
HTTPException(*args, detail=None, status_code=None, headers=None, **extra)
Bases: HTTPException
, EsmeraldAPIException
Base of all Esmerald
execeptions.
Tip
For an implementation of a custom exception that you need
to be thrown by Esmerald, it is advised to subclass HTTPException
.
PARAMETER | DESCRIPTION |
---|---|
*args |
The args passed to the exception.
TYPE:
|
detail |
A string text with the details of the error being thrown.
TYPE:
|
status_code |
An integer with the status code to be raised.
TYPE:
|
headers |
Any python dictionary containing headers.
TYPE:
|
**extra |
Any extra information used by the exception.
TYPE:
|
Source code in esmerald/exceptions.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
status_code
class-attribute
instance-attribute
¶
status_code = status.HTTP_500_INTERNAL_SERVER_ERROR