Hello @sislvacl ,
I actually have an issue open for this:
opened 06:22PM - 01 Dec 22 UTC
**Is your feature request related to a problem? Please describe.**
When errors … occur during callbacks on a production environment, with debug=False. This breaks the production and more than likely restarts the worker.
**Describe the solution you'd like**
When starting up the server, allow for a mailbox item like smtp to be passed in order to send error alerts with traceback messages to the identified email address. ie `app.run(mail=mail, error_to=emailaddress)` Then, when an error occurs, raise PreventUpdate or some other standard error message, along the lines of "IT has been notified of the error that just occurred."
**Describe alternatives you've considered**
Wrapping all callbacks with the try except clause where an alert is sent to my email.
I typically like to send myself/IT team of when something breaks.
What I’ve come up with is something like this:
def alertError(subject, error):
msg = ... subject
msg.body = error
mail.send(msg)
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'