nbagg backend captures exceptions raised by callbacks · Issue #5111 · matplotlib/matplotlib · GitHub
Skip to content

nbagg backend captures exceptions raised by callbacks #5111

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

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