Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router swallows exception information #199

Closed
cjw296 opened this issue May 30, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@cjw296
Copy link
Member

commented May 30, 2011

I'm trying to debug some velruse auth going wrong.

The exception I see in mod_wsgi's output to Apache is:

[Mon May 30 21:30:16 2011] [error] [client 93.89.128.162] File "/home/chris/buildout-eggs/python_openid-2.2.5-py2.6.egg/openid/message.py", line 476, in setArg, referer: http://pythonjobs.chrisw.info/login
[Mon May 30 21:30:16 2011] [error] [client 93.89.128.162] assert value is not None, referer: http://pythonjobs.chrisw.info/login
[Mon May 30 21:30:16 2011] [error] [client 93.89.128.162] AssertionError, referer: http://pythonjobs.chrisw.info/login

So try and get an exception in a log file that's more sane, I did:

@view_config(context=Exception)
def error_view(context,request):
logger.exception('500 Error: '+request.path)
return HTTPInternalServerError(body='500 Error:\n'+format_exc())

However, the exception logged by this is:

2011-05-30 21:58:35,173 ERROR [root][MainThread] 500 Error: /velruse/yahoo/auth
Traceback (most recent call last):
File "/home/chris/buildout-eggs/pyramid-1.0-py2.6.egg/pyramid/router.py", line 173, in call
msg = why[0]
IndexError: tuple index out of range

This is caused by this line:

https://github.com/Pylons/pyramid/blob/master/pyramid/router.py#L173

...which masks the original exception.
I hit this before, and I can't remember what I did to solve it, but this is pretty annoying so opening an issue here...

@cjw296

This comment has been minimized.

Copy link
Member Author

commented May 30, 2011

Here's a branch that fixes this, I'm afraid I don't have the knowledge to fix the issue and keep the backwards compatibility.
However, I will note that no tests appear to fail with the code ripped out as in the branch.

https://github.com/cjw296/pyramid/tree/1.0_routerfix

@cjw296

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2011

I truly hope this can get solved for 1.1! :-S

@mcdonc mcdonc closed this in c724f03 Jun 21, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.