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

Already on GitHub? Sign in to your account

http client hides exceptions generated in callbacks #652

wants to merge 1 commit into


None yet
2 participants

rhettg commented Dec 8, 2012

If an exception is generated in a callback (or callback chain) from the http client, the exception is caught by the cleanup() method which logs the exception, wraps it in an HTTPResponse and tries to pass it to the callback again. SInce the callback is already called, this is a no-op.

The consequence of this handling is that it's very difficult to get at unhandled errors.

In most cases, you can sub-class IOLoop by redefining handle_callback_exception() to have your own customized behavior for unhandled exceptions.

This patch keeps the existing behavior for exceptions generated before the callback, but re-raises exceptions after or during the callback, allowing handle_callback_exception() to deal with ALL unhandled exceptions.


bdarnell commented Dec 9, 2012

Thanks for the report. I've merged this change, and made a few other related changes for good measure.

@bdarnell bdarnell closed this in 6d9407f Dec 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment