From ff3dd9e9431035b479136abcc761a8f20341e3e2 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 9 Feb 2016 20:42:43 -0500 Subject: add request.exception and request.exc_info --- pyramid/view.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyramid/view.py b/pyramid/view.py index b09c08ccc..0f1a5e41c 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -583,8 +583,8 @@ class ViewMethodsMixin(object): If called with no arguments, it uses the global exception information returned by ``traceback.exc_info()`` as ``exc_info``, the request - object that the method is a member of as the ``request``, and - ``secure`` is ``True``. + object that this method is attached to as the ``request``, and + ``True`` for ``secure``. This method returns a :term:`response` object.""" @@ -597,6 +597,8 @@ class ViewMethodsMixin(object): exc_info = traceback.exc_info() context_iface = providedBy(exc_info[0]) view_name = getattr(request, 'view_name', '') + request.exception = exc_info[0] + request.exc_info = exc_info response = _call_view( registry, request, -- cgit v1.2.3