On 12/16/2014 12:59 PM, Ben Sizer wrote:
> I forgot to mention I was using Windows, so, good guess. ;)
>
> Anyway, this post inspired me to dig deeper and sprinkle some logging in
> there liberally. And I've found the change: at one point, I catch
> pymongo.errors.ConnectionFailure and raise
> pyramid.httpexceptions.HTTPInternalServerError in its place. In the
> past, I remember this still giving me a full traceback in development
> mode - not on-screen, where it shows a plain 500 page, but in the debug
> toolbar. Now it does not.
>
> I can't see any indication in the changelog of this behaviour having
> changed though. Am I misremembering how it used to work? Is there any
> worth in explicitly throwing server errors like this if there is no
> logging that goes along with it?
If you're catching a pymongo ConnectionFailure and turning it in to an
HTTPInternalServerError, Pyramid's "default exception response view" is
going to render it because that exception inherits from
pyramid.httpexceptions.HTTPException which the default exception
response view is also registered for, and no traceback will be shown
(and certainly not the original traceback, which is lost when you catch
it and reraise). I can't remember a time when this was not true.
- C
>
>
>
> On Monday, 15 December 2014 16:30:45 UTC, Jonathan Vanasco wrote:
>
>
> I've never used Pyramid under windows, so I could be off here...
>
> But when running under Mac/Linux, one can trip 500x error that just
> says "Invalid Request" (or similar) under a few scenarios:
>
> • exceptions in the wsgi middleware stack
> • exceptions in most areas of the debugtoolbar code
> • exceptions in very few areas of pyramid code(I think mostly in
> certain Events and Tweens)
>
> For the debugtoolbar to work (and show you the traceback) it needs
> to catch the exception. It can't catch the middleware errors, and
> raising exceptions in certain parts of pyramid code will not have a
> proper environment for the tracebacks to work. So these errors
> appear in the process log, but are inaccessible to the
> toolbar/interactive traceback mechanism. It sounds to me like this
> is what you're experiencing.
>
> Are you using any Event Subscribers ? ( I think I've triggered
> stuff like this with NewResponse can cause this ) I recall tweens
> having issues too. I think I also caused this with an exception in
> an __init__() function when using Class-based views.
>
> --
> 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
> <mailto:
pylons-discus...@googlegroups.com>.
> <mailto:
pylons-...@googlegroups.com>.