pyramid_exclog exception in exception view

23 views
Skip to first unread message

Jason

unread,
Jan 10, 2012, 10:29:29 AM1/10/12
to pylons-...@googlegroups.com
I have an exception handling view that handles HTTPNotFound exceptions and calls a Pylons wsgi application using request.get_response(). If request.get_response() raises an exception (eg AttributeError) pyramid_exclog is never called. It is called for the HTTPNotFound exception (and ignored), but does not get called again when the exception view raises an exception.

WebError correctly handled this scenario, but I'm guessing this has something to do with the difference between a Tween and WSGI Middleware?

I'm just going to add WebError to the Pylons application's middleware.py, but  any clarification about why the exclog tween doesn't work would be greatly appreciated.

--Jason

Michael Merickel

unread,
Jan 17, 2012, 6:19:10 PM1/17/12
to pylons-...@googlegroups.com
pyramid_exclog is placed "under" the exception view tween. This effectively means that the exclog is executed before the HTTPNotFound exception view. I don't have an awesome solution, but wanted to tell you why you're seeing what you're seeing.


--Jason

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/f8XF-7zbUOkJ.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.

Jason

unread,
Jan 18, 2012, 9:52:28 AM1/18/12
to pylons-...@googlegroups.com
Ahh yes, I just read that the exception view is implemented using a tween. So I probably have to explicitly order them to get what I want.

-- Jason
Reply all
Reply to author
Forward
0 new messages