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

[Feature Request] Optionally pass errors raised from a callback specific error handler to the global error handler #3036

Open
tlauli opened this issue Oct 15, 2024 · 0 comments

Comments

@tlauli
Copy link

tlauli commented Oct 15, 2024

Thanks so much for your interest in Dash!

Before posting an issue here, please check the Dash community forum to see if the topic has already been discussed. The community forum is also great for implementation questions. When in doubt, please feel free to just post the issue here :)

Is your feature request related to a problem? Please describe.
Currently if I define on_error for both the Dash() class and a for a specific callback, the callback specific on_error overwrites the global on_error. It would be nice to have an option to chain these error handlers, so that exceptions raised from the callback specific on_error are passed on to the global on_error.

Example I can think of:

  • callback specific on_error: handles user incorrectly filling in data
  • global on_error: catches unexpected errors (ie. bugs) and notifies the developer

Describe the solution you'd like
Perhaps a bool argument to the callback() decorator that would enable passing uncaught exceptions from the local on_error to the global on_error, and the same argument to the Dash() class which would be used as a default for all callbacks?

Describe alternatives you've considered

  • Wrapping callback specific on_error in a try catch block and calling the global error handler manually.
  • Wrapping the body of a callback in a try catch block and calling the callback specific on_error manually.
    I think both of these approaches are unnecessary boiler plate.

Additional context
Add any other context or screenshots about the feature request here.

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

No branches or pull requests

1 participant