OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, description=None, response=None) |
def | wrap (cls, exception, name=None) |
def | name (self) |
def | get_description (self, environ=None) |
def | get_body (self, environ=None) |
def | get_headers (self, environ=None) |
def | get_response (self, environ=None) |
def | __call__ (self, environ, start_response) |
def | __str__ (self) |
def | __repr__ (self) |
Data Fields | |
response | |
Static Public Attributes | |
code | |
description | |
Baseclass for all HTTP exceptions. This exception can be called as WSGI application to render a default error page or you can catch the subclasses of it independently and render nicer error messages.
def __init__ | ( | self, | |
description = None , |
|||
response = None |
|||
) |
Reimplemented in MethodNotAllowed.
def __call__ | ( | self, | |
environ, | |||
start_response | |||
) |
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 | ) |
def __str__ | ( | self | ) |
def get_body | ( | self, | |
environ = None |
|||
) |
Get the HTML body.
def get_description | ( | self, | |
environ = None |
|||
) |
Get the description.
def get_headers | ( | self, | |
environ = None |
|||
) |
Get a list of headers.
Reimplemented in _RetryAfter, RequestedRangeNotSatisfiable, MethodNotAllowed, and Unauthorized.
def get_response | ( | self, | |
environ = None |
|||
) |
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.
Reimplemented in RequestRedirect.
def name | ( | self | ) |
The status name.
def wrap | ( | cls, | |
exception, | |||
name = None |
|||
) |
Create an exception that is a subclass of the calling HTTP exception and the ``exception`` argument. The first argument to the class will be passed to the wrapped ``exception``, the rest to the HTTP exception. If ``e.args`` is not empty and ``e.show_exception`` is ``True``, the wrapped exception message is added to the HTTP error description. .. versionchanged:: 0.15.5 The ``show_exception`` attribute controls whether the description includes the wrapped exception message. .. versionchanged:: 0.15.0 The description includes the wrapped exception message.
|
static |
|
static |
response |