summaryrefslogtreecommitdiff
path: root/docs/narr/viewconfig.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2016-10-22 09:16:27 -0400
committerChris McDonough <chrism@plope.com>2016-10-22 09:16:27 -0400
commit7bb06f28ee296ecf43ba63279fc4c2439b4571d3 (patch)
tree10758a9c6980205c752e94e040fdb9433620859b /docs/narr/viewconfig.rst
parent85bd2b8187c39e44285983261a74aa815f2b19ed (diff)
parente73ae375581539ed42aa97d7cd6e96e6fbd64c79 (diff)
downloadpyramid-7bb06f28ee296ecf43ba63279fc4c2439b4571d3.tar.gz
pyramid-7bb06f28ee296ecf43ba63279fc4c2439b4571d3.tar.bz2
pyramid-7bb06f28ee296ecf43ba63279fc4c2439b4571d3.zip
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/narr/viewconfig.rst')
-rw-r--r--docs/narr/viewconfig.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst
index cd5b8feb0..7cb8e0306 100644
--- a/docs/narr/viewconfig.rst
+++ b/docs/narr/viewconfig.rst
@@ -34,7 +34,7 @@ determine the set of circumstances which must be true for the view callable to
be invoked.
A view configuration statement is made about information present in the
-:term:`context` resource and the :term:`request`.
+:term:`context` resource (or exception) and the :term:`request`.
View configuration is performed in one of two ways:
@@ -306,9 +306,26 @@ configured view.
represented class or if the :term:`context` resource provides the represented
interface; it is otherwise false.
+ It is possible to pass an exception class as the context if your context may
+ subclass an exception. In this case *two* views will be registered. One
+ will match normal incoming requests, and the other will match as an
+ :term:`exception view` which only occurs when an exception is raised during
+ the normal request processing pipeline.
+
If ``context`` is not supplied, the value ``None``, which matches any
resource, is used.
+``exception_only``
+
+ When this value is ``True``, the ``context`` argument must be a subclass of
+ ``Exception``. This flag indicates that only an :term:`exception view` should
+ be created, and that this view should not match if the traversal
+ :term:`context` matches the ``context`` argument. If the ``context`` is a
+ subclass of ``Exception`` and this value is ``False`` (the default), then a
+ view will be registered to match the traversal :term:`context` as well.
+
+ .. versionadded:: 1.8
+
``route_name``
If ``route_name`` is supplied, the view callable will be invoked only when
the named route has matched.