On Wed, Mar 21, 2012 at 1:06 PM, Jonathan Vanasco <jonat...@findmeon.com>wrote:
>
> The way the 'uncaught' exception bubbles up is a little weird -- it
> doesn't seem to exist anywhere within the event.  It just gets marked
> as "None" ( vs the request not having an attribute ). it would be
> really useful if it was logged.
>

The only way a NewResponse subscriber would be invoked *after* an exception
occured is if you are handling the exception in an exception view. If
that's the case, then you are rendering a new view and as part of the
rendering, NewResponse will be invoked, and request.exception will be the
exception.


> from sqlalchemy.exc import OperationalError as
> SqlAlchemyOperationalError
>
> @view_config(context=SqlAlchemyOperationalError)
> def failed_sqlalchemy(exception , request):
>    """do whatever here"
>    pass


This is an actual view, so you need to return a response object, or a dict
usable by a configured renderer.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to