summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmos Latteier <amos@latteier.com>2016-06-30 10:08:16 -0700
committerAmos Latteier <amos@latteier.com>2016-06-30 10:08:16 -0700
commit3fd41dcb5a94a73f43862f6d5c063af7b54e6ff3 (patch)
tree1d639e3523734a3834a302c0326b19dfbac1ddbf
parent74842ab6a6025d5058da4321658e7f51eb697ea0 (diff)
downloadpyramid-3fd41dcb5a94a73f43862f6d5c063af7b54e6ff3.tar.gz
pyramid-3fd41dcb5a94a73f43862f6d5c063af7b54e6ff3.tar.bz2
pyramid-3fd41dcb5a94a73f43862f6d5c063af7b54e6ff3.zip
fix docs typo, expand example.
-rw-r--r--pyramid/view.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pyramid/view.py b/pyramid/view.py
index 74c57d272..1895de96d 100644
--- a/pyramid/view.py
+++ b/pyramid/view.py
@@ -471,7 +471,7 @@ class exception_view_config(object):
exception view.
The exception_view_config constructor requires an exception context, and
- additionally accepts most of the same argumenta as the constructor of
+ additionally accepts most of the same arguments as the constructor of
:class:`pyramid.view.view_config`. It can be used in the same places,
and behaves in largely the same way, except it always registers an exception
view instead of a 'normal' view.
@@ -483,9 +483,9 @@ class exception_view_config(object):
from pyramid.view import exception_view_config
from pyramid.response import Response
- @exception_view_config(context=ValueError)
- def error_view(request):
- return Response('A value error ocurred')
+ @exception_view_config(context=ValueError, renderer='json')
+ def error_view(context, request):
+ return {'error': str(context)}
All arguments passed to this function have the same meaning as
:meth:`pyramid.view.view_config` and each predicate argument restricts