module documentation

Undocumented

Function convert​_exception​_to​_response Wrap the given get_response callable in exception-to-response conversion.
Function get​_exception​_response Undocumented
Function handle​_uncaught​_exception Processing for any otherwise uncaught exceptions (those that will generate HTTP 500 responses).
Function response​_for​_exception Undocumented
def convert_exception_to_response(get_response):

Wrap the given get_response callable in exception-to-response conversion.

All exceptions will be converted. All known 4xx exceptions (Http404, PermissionDenied, MultiPartParserError, SuspiciousOperation) will be converted to the appropriate response, and all other exceptions will be converted to 500 responses.

This decorator is automatically applied to all middleware to ensure that no middleware leaks an exception and that the next middleware in the stack can rely on getting a response instead of an exception.

def get_exception_response(request, resolver, status_code, exception):

Undocumented

def handle_uncaught_exception(request, resolver, exc_info):
Processing for any otherwise uncaught exceptions (those that will generate HTTP 500 responses).
def response_for_exception(request, exc):

Undocumented