summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKiall Mac Innes <kiall@hp.com>2013-07-19 11:14:42 +0100
committerKiall Mac Innes <kiall@hp.com>2013-07-20 12:03:28 +0100
commit2b505a5a246f51e74a5e7e0a610a70e7bbaec53d (patch)
treed9224c8368cc9c204d23b97a478fa8b75a0bc969 /docs
parentf5269b65e2f318e6cb17f5737ad838df25d7ac00 (diff)
downloadpecan-2b505a5a246f51e74a5e7e0a610a70e7bbaec53d.tar.gz
Allow on_error hooks to return a Response.
This allows on_error hooks to prevent the exception from being re-raised, and instead causes the returned Response to be provided to the end user. The first on_error hook to return a response "wins", and the remaining on_error hooks are not ran.
Diffstat (limited to 'docs')
-rw-r--r--docs/source/hooks.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/source/hooks.rst b/docs/source/hooks.rst
index 9a9d099..e1c54c4 100644
--- a/docs/source/hooks.rst
+++ b/docs/source/hooks.rst
@@ -46,8 +46,10 @@ object which includes useful information, such as
the request and response objects, and which controller was selected by
Pecan's routing.
-:func:`on_error` is passed a shared state object **and** the original exception.
-
+:func:`on_error` is passed a shared state object **and** the original exception. If
+an :func:`on_error` handler returns a Response object, this response will be returned
+to the end user and no furthur :func:`on_error` hooks will be executed.
+
Attaching Hooks
---------------