On Fri, Apr 28, 2017 at 1:25 PM, Theron Luhn <[email protected]> wrote:

> Do you know the motivation for pyramid_tm to be above EXC_VIEW by
> default?  I moved it below EXC_VIEW since I wanted commit errors to be
> handled by the exception views.  Is there any reason why I shouldn’t do
> this?


The goal is to allow exception views to use managed objects loaded by
database queries (such as request.user). If pyramid_tm is under the excview
then these objects are expired. It is possible to invoke exception views at
any time, not just via the excview tween. You can add another tween over
pyramid_tm that will use request.invoke_exception_view but alternatively in
Pyramid 1.9 pyramid_retry will do this for you automatically -> meaning
that if an exception hits the top of the stack, pyramid_retry will perform
a last-ditch effort to render an exception response for you. It is true
that in Pyramid 1.8 nothing, by default, will catch commit errors now that
pyramid_tm is over the excview.

- Michael

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwGaHug9QJtGBzFn4V8SWFP1QTHKU9XyVyW%2BuoWR%2BJoXLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to