Skip to content

nbagg backend captures exceptions raised by callbacks #5111

Closed

Description

@ngoldbaum

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.

Activity

  1. tacaswell commented on Sep 21, 2015

    @tacaswell
    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.

  2. added this to the milestone on Sep 21, 2015
  3. OceanWolf commented on Sep 21, 2015

    @OceanWolf
    Member

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

  4. tacaswell commented on Sep 21, 2015

    @tacaswell
    Member

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

  5. OceanWolf commented on Sep 21, 2015

    @OceanWolf
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions