-
Notifications
You must be signed in to change notification settings - Fork 82
Description
I tracked down an odd issue (which is a bit of a variant from closed #237)
this is caused by the pyramid design of finished callbacks happening after the tween egress.
If an exception is raised in a finished callback, the debugtoolbar has already considered the request to be fine -- so the client gets an error (e.g the two line waitress internal-server error) but the toolbar shows a 200.
a simple example of this is setting a value in a cookie that is too long (there is a max 4096 length due to browser header limitations)
for example, this will trigger an uncaught exception
from pyramid.session import SignedCookieSessionFactory
my_session_factory = SignedCookieSessionFactory('itsaseekreet')
config.set_session_factory(my_session_factory)
...
def a_view(request):
request.session['a'] = "1" * 5000
return {}
i don't think it's possible to catch these exceptions with the current design of pyramid or the toolbar, but i think it would be good to remember this type of situation as future plans are made.