From 3fd41dcb5a94a73f43862f6d5c063af7b54e6ff3 Mon Sep 17 00:00:00 2001 From: Amos Latteier Date: Thu, 30 Jun 2016 10:08:16 -0700 Subject: fix docs typo, expand example. --- pyramid/view.py | 8 ++++---- 1 file 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 -- cgit v1.2.3