I’m wondering about this as well … I have some callbacks that will fail in some cases, and I’d like to display a warning to the user when they do.
I can imagine a few hack-ish ways of doing this, storing state in hidden divs, some try/excepts, etc., but this seems a bit clunky for production.
What I’d really like something like the solution proposed in Improving handling of aborted callbacks but with an addition like:
@app.handle_callback_errors(Output('my-user-warning-div', 'value'), [my_callback_func])
def handle_error(error):
# whenever a callback (e.g. my_callback_func) raises a PreventUpdate exception, the exception
# is passed to this handle_error function, which is itself a callback and can display a warning to the user
Would something like this be possible within the design of Dash?