CHANGES.txt | ●●●●● patch | view | raw | blame | history | |
pyramid/tweens.py | ●●●●● patch | view | raw | blame | history | |
pyramid/view.py | ●●●●● patch | view | raw | blame | history |
CHANGES.txt
@@ -125,11 +125,16 @@ ``request.exception`` and ``request.exc_info`` themselves to indicate the exception that was squashed when generating the response. Similar behavior occurs with ``request.invoke_exception_view`` in which the exception properties are set to reflect the exception if a response is successfully generated by the method. This is a very minor incompatibility. Most tweens right now would give priority to the raised exception and ignore ``request.exception``. This change just improves and clarifies that bookkeeping by trying to be more clear about the relationship between the response and its squashed exception. See https://github.com/Pylons/pyramid/pull/3029 exception. See https://github.com/Pylons/pyramid/pull/3029 and https://github.com/Pylons/pyramid/pull/3031 Documentation Changes --------------------- pyramid/tweens.py
@@ -21,7 +21,18 @@ """ A :term:`tween` factory which produces a tween that catches an exception raised by downstream tweens (or the main Pyramid request handler) and, if possible, converts it into a Response using an :term:`exception view`.""" :term:`exception view`. .. versionchanged:: 1.9 The ``request.response`` will be remain unchanged even if the tween handles an exception. Previously it was deleted after handling an exception. Also, ``request.exception`` and ``request.exc_info`` are only set if the tween handles an exception and returns a response otherwise they are left at their original values. """ def excview_tween(request): try: pyramid/view.py
@@ -664,6 +664,11 @@ response. Otherwise the previous values for ``request.exception`` and ``request.exc_info`` will be restored. .. versionchanged:: 1.9 The ``request.exception`` and ``request.exc_info`` properties will reflect the exception used to render the response where previously they were reset to the values prior to invoking the method. """ if request is None: request = self