OpenQuizz
Une application de gestion des contenus pédagogiques
HTTPException Class Reference
Inheritance diagram for HTTPException:
Collaboration diagram for HTTPException:

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
 

Detailed 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.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  description = None,
  response = None 
)

Reimplemented in MethodNotAllowed.

Member Function Documentation

◆ __call__()

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.

◆ __repr__()

def __repr__ (   self)

◆ __str__()

def __str__ (   self)

◆ get_body()

def get_body (   self,
  environ = None 
)
Get the HTML body.

◆ get_description()

def get_description (   self,
  environ = None 
)
Get the description.

◆ get_headers()

def get_headers (   self,
  environ = None 
)
Get a list of headers.

Reimplemented in _RetryAfter, RequestedRangeNotSatisfiable, MethodNotAllowed, and Unauthorized.

◆ get_response()

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.

◆ name()

def name (   self)
The status name.

◆ wrap()

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.

Field Documentation

◆ code

code
static

◆ description

description
static

◆ response

response

The documentation for this class was generated from the following file: