summaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorKarl O. Pinc <kop@meme.com>2013-10-08 11:50:11 -0500
committerKarl O. Pinc <kop@meme.com>2013-10-08 12:12:04 -0500
commit0905d2015e35e827c3fdb2135695710b80d549a5 (patch)
treead4c74054633651bd100c635853109b437ab6e44 /docs/api
parent4223668ee4c0d0ac0e981f3241d56ffa805ba6d1 (diff)
downloadpyramid-0905d2015e35e827c3fdb2135695710b80d549a5.tar.gz
pyramid-0905d2015e35e827c3fdb2135695710b80d549a5.tar.bz2
pyramid-0905d2015e35e827c3fdb2135695710b80d549a5.zip
Subclass HTTPBadCSRFToken from HTTPBadRequest and have request.session.check_csrf_token use the new exception.
This supports a more fine-grained exception trapping.
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/httpexceptions.rst19
1 files changed, 16 insertions, 3 deletions
diff --git a/docs/api/httpexceptions.rst b/docs/api/httpexceptions.rst
index 6a08d1048..0fdd0f0e9 100644
--- a/docs/api/httpexceptions.rst
+++ b/docs/api/httpexceptions.rst
@@ -7,9 +7,12 @@
.. attribute:: status_map
- A mapping of integer status code to exception class (eg. the
- integer "401" maps to
- :class:`pyramid.httpexceptions.HTTPUnauthorized`).
+ A mapping of integer status code to HTTP exception class (eg. the integer
+ "401" maps to :class:`pyramid.httpexceptions.HTTPUnauthorized`). All
+ mapped exception classes are children of :class:`pyramid.httpexceptions`,
+ i.e. the :ref:`pyramid_specific_http_exceptions` such as
+ :class:`pyramid.httpexceptions.HTTPBadRequest.BadCSRFToken` are not
+ mapped.
.. autofunction:: exception_response
@@ -106,3 +109,13 @@
.. autoclass:: HTTPVersionNotSupported
.. autoclass:: HTTPInsufficientStorage
+
+
+.. _pyramid_specific_http_exceptions:
+
+Pyramid-specific HTTP Exceptions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Each Pyramid-specific HTTP exception has the status code of it's parent.
+
+ .. autoclass:: HTTPBadCSRFToken