Documentation Suggestions for Subscribers or Debug

17 views
Skip to first unread message

Jonathan Vanasco

unread,
May 15, 2012, 6:57:25 PM5/15/12
to pylons-devel
I ran into an issue a few months ago regarding a NewResponse
subscriber and failing to catch errors (
https://groups.google.com/group/pylons-discuss/browse_thread/thread/54b5b3eb5e2ccfe/4e9a2abc09b9651f
)

As I prepare for a production release , my old code ( which i forgot
to remove ) started firing -- and I finally figured out what was
happening.

Because I had debugging turned on via 'development.ini', Pyramid was
catching the error & response object from the app, and replacing it
with its own.

In a perfect world, the Pyramid debug system would let the original
response/request stuff somehow persist -- so code can be written that
works on production and development.

In a less perfect, though perfectly acceptable world, it would be
great if the debug & event subscriber docs cross-referenced one
another with an alert/note box that simply states that the debug
system will 'overtake' the response object when turned on, and
subscribers that are designed to handle errors may not work as desired
when debugging is enabled.

Michael Merickel

unread,
May 15, 2012, 7:33:26 PM5/15/12
to pylons...@googlegroups.com
What? Pyramid doesn't have a "debug" code path, minus emitting some
log messages. Do you mean that the debugtoolbar is doing something to
the response?
> --
> You received this message because you are subscribed to the Google Groups "pylons-devel" group.
> To post to this group, send email to pylons...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-devel...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.
>

Jonathan Vanasco

unread,
May 15, 2012, 10:43:11 PM5/15/12
to pylons-devel


On May 15, 7:33 pm, Michael Merickel <mmeri...@gmail.com> wrote:
> What? Pyramid doesn't have a "debug" code path, minus emitting some
> log messages. Do you mean that the debugtoolbar is doing something to
> the response?

I'd imagine its either the error screens from pyramid_debugtoolbar or
whatever settings like debug_templates control.

pyramid.debug_templates = true
pyramid.includes = pyramid_debugtoolbar

when they're enabled, they seem to hijack the response object and
replease it with their own -- it no longer contains any trace of the
raised exception (unless you regex the debug screen html)

Michael Merickel

unread,
May 15, 2012, 10:57:22 PM5/15/12
to pylons...@googlegroups.com
I'll need to see an example. I can't think of anything except an
exception view that can replace the response object. Even the toolbar
only mutates the body of the response.
Reply all
Reply to author
Forward
0 new messages