summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2011-08-25 03:21:38 -0500
committerMichael Merickel <michael@merickel.org>2011-08-25 03:21:38 -0500
commit5bcab687562b667e3e1ceb8ca9075e524c064d3a (patch)
treeab14c036f65c9098896ba12221f38a83152823b3
parent596860a10e8356e72aa695f77c3c8c4dbf269c52 (diff)
downloadpyramid-5bcab687562b667e3e1ceb8ca9075e524c064d3a.tar.gz
pyramid-5bcab687562b667e3e1ceb8ca9075e524c064d3a.tar.bz2
pyramid-5bcab687562b667e3e1ceb8ca9075e524c064d3a.zip
More explicitly discussed properties of HTTPException objects.
-rw-r--r--pyramid/httpexceptions.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py
index dd3db3a9d..0887b0eec 100644
--- a/pyramid/httpexceptions.py
+++ b/pyramid/httpexceptions.py
@@ -62,7 +62,10 @@ Exception
* 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
@@ -86,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``
@@ -102,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.