summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2013-04-09 14:00:16 -0400
committerRyan Petrello <lists@ryanpetrello.com>2013-04-09 14:00:16 -0400
commitb5d69b5624f3e359c3c0c898e2b2dd23f85af01b (patch)
tree4f84e4ee1ac1fb1c42d4a14152a5a1b0cc330ab6 /docs
parentc3339f27552f38f16ad74e0f9da2da198cb8585a (diff)
downloadpecan-b5d69b5624f3e359c3c0c898e2b2dd23f85af01b.tar.gz
Store exceptions raised by ``abort`` in the WSGI environ.
This makes it easier to access the original exception later in the request cycle (e.g., other middleware or in custom error handlers).
Diffstat (limited to 'docs')
-rw-r--r--docs/source/routing.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/source/routing.rst b/docs/source/routing.rst
index e27baf6..6ed3524 100644
--- a/docs/source/routing.rst
+++ b/docs/source/routing.rst
@@ -163,6 +163,13 @@ Pecan also comes with ``abort``, a utility function for raising HTTP errors:
abort(404)
+Under the hood, ``abort`` raises an instance of
+``webob.exc.WSGIHTTPException`` which is used by pecan to render default
+response bodies for HTTP errors. This exception is stored in the WSGI request
+environ at ``pecan.original_exception``, where it can be accessed later in the
+request cycle (by, for example, other middleware or :ref:`errors`).
+
+
Routing to Subcontrollers with ``_lookup``
------------------------------------------