diff options
| author | Chris McDonough <chrism@plope.com> | 2011-08-25 05:45:27 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-08-25 05:45:27 -0400 |
| commit | 5476e949f999bc7cf9fb522caf013ab11ea23b5b (patch) | |
| tree | ab14c036f65c9098896ba12221f38a83152823b3 | |
| parent | 0e9fe538b53ca62b8e9400f624e25ddd9bb7d07e (diff) | |
| parent | 5bcab687562b667e3e1ceb8ca9075e524c064d3a (diff) | |
| download | pyramid-5476e949f999bc7cf9fb522caf013ab11ea23b5b.tar.gz pyramid-5476e949f999bc7cf9fb522caf013ab11ea23b5b.tar.bz2 pyramid-5476e949f999bc7cf9fb522caf013ab11ea23b5b.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
| -rw-r--r-- | docs/api/httpexceptions.rst | 8 | ||||
| -rw-r--r-- | pyramid/httpexceptions.py | 16 |
2 files changed, 22 insertions, 2 deletions
diff --git a/docs/api/httpexceptions.rst b/docs/api/httpexceptions.rst index 89be17a2d..6a08d1048 100644 --- a/docs/api/httpexceptions.rst +++ b/docs/api/httpexceptions.rst @@ -87,6 +87,12 @@ .. autoclass:: HTTPExpectationFailed + .. autoclass:: HTTPUnprocessableEntity + + .. autoclass:: HTTPLocked + + .. autoclass:: HTTPFailedDependency + .. autoclass:: HTTPInternalServerError .. autoclass:: HTTPNotImplemented @@ -98,3 +104,5 @@ .. autoclass:: HTTPGatewayTimeout .. autoclass:: HTTPVersionNotSupported + + .. autoclass:: HTTPInsufficientStorage diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index fef4fe47e..0887b0eec 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -50,6 +50,9 @@ Exception * 415 - HTTPUnsupportedMediaType * 416 - HTTPRequestRangeNotSatisfiable * 417 - HTTPExpectationFailed + * 422 - HTTPUnprocessableEntity + * 423 - HTTPLocked + * 424 - HTTPFailedDependency HTTPServerError * 500 - HTTPInternalServerError * 501 - HTTPNotImplemented @@ -57,8 +60,12 @@ Exception * 503 - HTTPServiceUnavailable * 504 - HTTPGatewayTimeout * 505 - HTTPVersionNotSupported + * 507 - HTTPInsufficientStorage -Each HTTP exception has the following attributes: +HTTP exceptions are also :term:`response` objects, thus they accept most of +the same parameters that can be passed to a regular +:class:`~pyramid.response.Response`. Each HTTP exception also has the +following attributes: ``code`` the HTTP status code for the exception @@ -82,7 +89,8 @@ Each HTTP exception has the following attributes: the explanation and further detail provided in the message. -Each HTTP exception accepts the following parameters: +Each HTTP exception accepts the following parameters, any others will +be forwarded to its :class:`~pyramid.response.Response` superclass: ``detail`` a plain-text override of the default ``detail`` @@ -98,6 +106,10 @@ Each HTTP exception accepts the following parameters: a ``string.Template`` object containing a content fragment in HTML that frames the explanation and further detail + ``body`` + a string that will override the ``body_template`` and be used as the + body of the response. + Substitution of response headers into template values is always performed. Substitution of WSGI environment values is performed if a ``request`` is passed to the exception's constructor. |
