summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2017-05-04 00:23:18 -0500
committerMichael Merickel <michael@merickel.org>2017-05-04 00:25:28 -0500
commite2e51b35303e69b5028a84026837095b1bfe6f79 (patch)
treee6c456d719aab68160ea6acdb8990f325cd43bc5
parentba677d566e86545ec46920d1a1279aade14ae70e (diff)
downloadpyramid-e2e51b35303e69b5028a84026837095b1bfe6f79.tar.gz
pyramid-e2e51b35303e69b5028a84026837095b1bfe6f79.tar.bz2
pyramid-e2e51b35303e69b5028a84026837095b1bfe6f79.zip
add changelog for #3031
-rw-r--r--CHANGES.txt7
-rw-r--r--pyramid/tweens.py13
-rw-r--r--pyramid/view.py5
3 files changed, 23 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index b299ed6e9..80b5003c1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -125,11 +125,16 @@ Backward Incompatibilities
``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
---------------------
diff --git a/pyramid/tweens.py b/pyramid/tweens.py
index c9b3bd4b8..740b6961c 100644
--- a/pyramid/tweens.py
+++ b/pyramid/tweens.py
@@ -21,7 +21,18 @@ def excview_tween_factory(handler, registry):
""" 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:
diff --git a/pyramid/view.py b/pyramid/view.py
index 3ce984209..0c1b8cd97 100644
--- a/pyramid/view.py
+++ b/pyramid/view.py
@@ -664,6 +664,11 @@ class ViewMethodsMixin(object):
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