exception documentation

The base class for all HTTP exceptions. This exception can be called as a WSGI application to render a default error page or you can catch the subclasses of it independently and render nicer error messages. .. versionchanged:: 2.1 Removed the ``wrap`` class method.

Method __call__ Call the exception as WSGI application.
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method get_body Get the HTML body.
Method get_description Get the description.
Method get_headers Get a list of headers.
Method get_response Get a response object. If one was passed to the exception it's returned directly.
Class Variable code Undocumented
Instance Variable description Undocumented
Instance Variable response Undocumented
Property name The status name.
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> t.Iterable[bytes]: (source)

Call the exception as WSGI application. :param environ: the WSGI environment. :param start_response: the response callable provided by the WSGI server.

def __repr__(self) -> str: (source)

Undocumented

def __str__(self) -> str: (source)

Undocumented

def get_body(self, environ: t.Optional[WSGIEnvironment] = None, scope: t.Optional[dict] = None) -> str: (source)

Get the HTML body.

def get_description(self, environ: t.Optional[WSGIEnvironment] = None, scope: t.Optional[dict] = None) -> str: (source)

Get the description.

def get_response(self, environ: t.Optional[t.Union[WSGIEnvironment, WSGIRequest]] = None, scope: t.Optional[dict] = None) -> Response: (source)

Get a response object. If one was passed to the exception it's returned directly. :param environ: the optional environ for the request. This can be used to modify the response depending on how the request looked like. :return: a :class:`Response` object or a subclass thereof.

response = (source)

Undocumented

The status name.