Oh.. that.. yeah. Without providing any useful information, I can just say
that I tend to avoid NewRequest subscribers like the plague now that
config.add_request_method exists.

This sounds like a more fundamental issue with the toolbar. It historically
causes all sorts of odd problems that some of its urls are handled within
your Pyramid application.


On Wed, Feb 13, 2013 at 4:25 PM, Wyatt Baldwin
<wyatt.lee.bald...@gmail.com>wrote:

> I created a minimal test case. The exception raised by the view is caught
> by pyramid_debugtoolbar. The exception raised by the NewRequest callback is
> caught but isn't displayed correctly because requests to /_debug_toolbar/*
> hit the same exception.
>
> I can fix this by returning early from the callback if PATH_INFO starts
> with /_debug_toolbar, but maybe there's a better way.
>
> But this is a bit different from what I'm seeing in my actual app, which
> is that the exeption doesn't appear to be caught at all. More investigation
> under way...
>
>
> from waitress import serve
>
> from pyramid.config import Configurator
> from pyramid.events import NewRequest
>
>
> def main(global_config, **settings):
>     settings['pyramid.includes'] = ['pyramid_debugtoolbar']
>
>     config = Configurator(settings=settings)
>     def callback(event):
>         something()
>     #config.add_subscriber(callback, NewRequest)
>     config.add_route('route', '/route')
>     config.add_view(view, route_name='route', renderer='string')
>
>     app = config.make_wsgi_app()
>     return app
>
>
> def view(request):
>     return xxx
>
>
> def something():
>     raise Exception
>
>
> if __name__ == '__main__':
>     app = main({})
>
>     serve(app)
>
>
>
> On Wednesday, February 13, 2013 1:40:00 PM UTC-8, Wyatt Baldwin wrote:
>>
>> I'm using Pyramid 1.4. pyramid_debugtoolbar is included via the
>> pyramid.includes settings. I'm not using any other includes or tweens. The
>> subscriber is set up like this:
>>
>> def main(global_config, *settings):
>>     config = Configurator(settings=**settings)
>>     def callback(event):
>>         """Exceptions raised here are not caught by
>> pyramid_debugtoolbar"""
>>     config.add_subscriber(**callback, NewRequest)
>>     app = config.make_wsgi_app()
>>     return app
>>
>>
>> On Wednesday, February 13, 2013 11:15:48 AM UTC-8, Michael Merickel wrote:
>>>
>>> Without more info I can say it's not expected on anything after Pyramid
>>> 1.0 where NewRequest subscribers explicitly did not support exceptions.
>>>
>>>
>>> On Wed, Feb 13, 2013 at 12:45 PM, Wyatt Baldwin 
>>> <wyatt.le...@gmail.com>wrote:
>>>
>>>> I have a NewRequest subscriber that's added in main() via
>>>> config.add_subscriber(). Exceptions thrown in this subscriber aren't caught
>>>> by pyramid_debugtoolbar. Is this behavior expected?
>>>>
>>>> --
>>>> 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 pylons-discus...@googlegroups.**com.
>>>> To post to this group, send email to pylons-...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/**
>>>> group/pylons-discuss?hl=en<http://groups.google.com/group/pylons-discuss?hl=en>
>>>> .
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>>  --
> 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 pylons-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to