The HTTPExceptionHandler class is accessible via the paste.httpexceptions module.
Attributes:
- warning_level
- This attribute determines for what exceptions a stack trace is kept for lower level reporting; by default, it only keeps stack trace for 5xx, HTTPServerError exceptions. To keep a stack trace for 4xx, HTTPClientError exceptions, set this to 400.
This middleware catches any exceptions (which are subclasses of HTTPException) and turns them into proper HTTP responses. Note if the headers have already been sent, the stack trace is always maintained as this indicates a programming error.
See the source for more information.