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

nbagg backend captures exceptions raised by callbacks #5111

Closed
ngoldbaum opened this issue Sep 21, 2015 · 4 comments
Closed

nbagg backend captures exceptions raised by callbacks #5111

ngoldbaum opened this issue Sep 21, 2015 · 4 comments

Comments

@ngoldbaum
Copy link
Contributor

This is illustrated by this notebook:

https://gist.github.com/anonymous/e6cb1acd8bfbfda35bf1

The code in the notebook is adapted from an example in the matplotlib docs. I've modified the example so that the ax_update function simply raises an error instead of doing anything useful. This is supposed to represent a buggy callback function that raises an exception.

Using the nbagg backend, if I run the notebook and then zoom in somewhere on the right-hand axis, I do not get a traceback printed in the notebook despite the fact that ax_update is being called and raising an exception.

Using the macosx backend doing the exact same thing does print out a traceback after manipulating the right-hand axes in the GUI window.

Not getting information about errors raised by callback functions makes it very difficult to debug callbacks using the nbagg backend. It would be much better if errors were raised to the level of the user.

@tacaswell
Copy link
Member

Sorry for not responding sooner. This behavior is not intentional.

This is an issue is due to how the communication between the figure and the kernel works over the comm. The exception is getting set back over the comm, but the nbagg object is ignoring it.

@fperez opened an issue someplace on the ipython/jupyter side about a related issues (print statements also don't get propogated), but I can not find it to link.

@tacaswell tacaswell added this to the proposed next point release (2.1) milestone Sep 21, 2015
@OceanWolf
Copy link
Contributor

Remind me to take a look at this bug when I get onto MEP22+27 for nbagg.

@tacaswell
Copy link
Member

This will probably also be improved when nbagg in converted over to being a proper widget rather than our roll-your-own div.

@OceanWolf
Copy link
Contributor

You mean akin to the widgetisaton I did for WebAgg in the MEP27 branch?

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

No branches or pull requests

3 participants