Could you recommend me an approach how to add a notification system to an existing Dash app? The main purpose for the notification system is to report errors (Python exceptions) that might occur inside of any callback function.
My app is a fairly large multi-page app. The app is heavily using pattern-matching callbacks. It uses @app.long_callback() as well as manually implemented async. callbacks.
For the callback logic, I was thinking that a decorator function that would do the error handling and would wrap my existing callbacks might be a good approach. But I am not sure how I would deal with the fact that the decorated functions (my callback functions) can have various numbers of outputs.
And then I send the error to the team. The error is normally traceback.format_exc()
def callback(...):
try:
## code
return valid response
except:
alertError(callback error, traceback.format_exc()
return 'There was an error, IT has been notified'