class HTTPException(Exception): (source)
Known subclasses: werkzeug.exceptions.BadGateway
, werkzeug.exceptions.BadRequest
, werkzeug.exceptions.Conflict
, werkzeug.exceptions.ExpectationFailed
, werkzeug.exceptions.FailedDependency
, werkzeug.exceptions.Forbidden
, werkzeug.exceptions.GatewayTimeout
, werkzeug.exceptions.Gone
, werkzeug.exceptions.HTTPVersionNotSupported
, werkzeug.exceptions.ImATeapot
, werkzeug.exceptions.InternalServerError
, werkzeug.exceptions.LengthRequired
, werkzeug.exceptions.Locked
, werkzeug.exceptions.MethodNotAllowed
, werkzeug.exceptions.NotAcceptable
, werkzeug.exceptions.NotFound
, werkzeug.exceptions.NotImplemented
, werkzeug.exceptions.PreconditionFailed
, werkzeug.exceptions.PreconditionRequired
, werkzeug.exceptions.RequestedRangeNotSatisfiable
, werkzeug.exceptions.RequestEntityTooLarge
, werkzeug.exceptions.RequestHeaderFieldsTooLarge
, werkzeug.exceptions.RequestTimeout
, werkzeug.exceptions.RequestURITooLarge
, werkzeug.exceptions.Unauthorized
, werkzeug.exceptions.UnavailableForLegalReasons
, werkzeug.exceptions.UnprocessableEntity
, werkzeug.exceptions.UnsupportedMediaType
, werkzeug.routing.exceptions.RequestRedirect
, werkzeug.exceptions._RetryAfter
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 |
Get the HTML body. |
Method | get |
Get the description. |
Method | get |
Get a list of headers. |
Method | get |
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. |
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.
t.Optional[ str]
= None, response: t.Optional[ Response]
= None):
(source)
¶
werkzeug.exceptions.BadRequestKeyError
, werkzeug.exceptions.InternalServerError
, werkzeug.exceptions.MethodNotAllowed
, werkzeug.exceptions.RequestedRangeNotSatisfiable
, werkzeug.exceptions.Unauthorized
, werkzeug.routing.exceptions.RequestRedirect
, werkzeug.exceptions._RetryAfter
Undocumented
t.Optional[ WSGIEnvironment]
= None, scope: t.Optional[ dict]
= None) -> str
:
(source)
¶
Get the HTML body.
t.Optional[ WSGIEnvironment]
= None, scope: t.Optional[ dict]
= None) -> str
:
(source)
¶
Get the description.
t.Optional[ WSGIEnvironment]
= None, scope: t.Optional[ dict]
= None) -> t.List[ t.Tuple[ str, str]]
:
(source)
¶
werkzeug.exceptions.MethodNotAllowed
, werkzeug.exceptions.RequestedRangeNotSatisfiable
, werkzeug.exceptions.Unauthorized
, werkzeug.exceptions._RetryAfter
Get a list of headers.
t.Optional[ t.Union[ WSGIEnvironment, WSGIRequest]]
= None, scope: t.Optional[ dict]
= None) -> Response
:
(source)
¶
werkzeug.routing.exceptions.RequestRedirect
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.
werkzeug.exceptions.BadGateway
, werkzeug.exceptions.BadRequest
, werkzeug.exceptions.Conflict
, werkzeug.exceptions.ExpectationFailed
, werkzeug.exceptions.FailedDependency
, werkzeug.exceptions.Forbidden
, werkzeug.exceptions.GatewayTimeout
, werkzeug.exceptions.Gone
, werkzeug.exceptions.HTTPVersionNotSupported
, werkzeug.exceptions.ImATeapot
, werkzeug.exceptions.InternalServerError
, werkzeug.exceptions.LengthRequired
, werkzeug.exceptions.Locked
, werkzeug.exceptions.MethodNotAllowed
, werkzeug.exceptions.NotAcceptable
, werkzeug.exceptions.NotFound
, werkzeug.exceptions.NotImplemented
, werkzeug.exceptions.PreconditionFailed
, werkzeug.exceptions.PreconditionRequired
, werkzeug.exceptions.RequestedRangeNotSatisfiable
, werkzeug.exceptions.RequestEntityTooLarge
, werkzeug.exceptions.RequestHeaderFieldsTooLarge
, werkzeug.exceptions.RequestTimeout
, werkzeug.exceptions.RequestURITooLarge
, werkzeug.exceptions.ServiceUnavailable
, werkzeug.exceptions.TooManyRequests
, werkzeug.exceptions.Unauthorized
, werkzeug.exceptions.UnavailableForLegalReasons
, werkzeug.exceptions.UnprocessableEntity
, werkzeug.exceptions.UnsupportedMediaType
, werkzeug.routing.exceptions.RequestRedirect
Undocumented
werkzeug.exceptions.BadGateway
, werkzeug.exceptions.BadRequest
, werkzeug.exceptions.Conflict
, werkzeug.exceptions.ExpectationFailed
, werkzeug.exceptions.FailedDependency
, werkzeug.exceptions.Forbidden
, werkzeug.exceptions.GatewayTimeout
, werkzeug.exceptions.Gone
, werkzeug.exceptions.HTTPVersionNotSupported
, werkzeug.exceptions.ImATeapot
, werkzeug.exceptions.InternalServerError
, werkzeug.exceptions.LengthRequired
, werkzeug.exceptions.Locked
, werkzeug.exceptions.MethodNotAllowed
, werkzeug.exceptions.NotAcceptable
, werkzeug.exceptions.NotFound
, werkzeug.exceptions.NotImplemented
, werkzeug.exceptions.PreconditionFailed
, werkzeug.exceptions.PreconditionRequired
, werkzeug.exceptions.RequestedRangeNotSatisfiable
, werkzeug.exceptions.RequestEntityTooLarge
, werkzeug.exceptions.RequestHeaderFieldsTooLarge
, werkzeug.exceptions.RequestTimeout
, werkzeug.exceptions.RequestURITooLarge
, werkzeug.exceptions.ServiceUnavailable
, werkzeug.exceptions.TooManyRequests
, werkzeug.exceptions.Unauthorized
, werkzeug.exceptions.UnavailableForLegalReasons
, werkzeug.exceptions.UnprocessableEntity
, werkzeug.exceptions.UnsupportedMediaType
Undocumented