exceptions.py
Provides HTTPException class for error handling.
HTTPException
dataclass
Bases: Response, Exception
Exception that also acts as a valid HTTP response.
Source code in jetweb/exceptions.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
from_exception(exception, catch_traceback)
classmethod
Convert any exception into an HTTPException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exception
|
BaseException
|
Original exception. |
required |
catch_traceback
|
bool
|
Include traceback text if True. |
required |
Returns:
| Type | Description |
|---|---|
HTTPException
|
HTTPException object. |
Source code in jetweb/exceptions.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |