You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone!
I used this decorator to record all exceptions in the app, but it seems that one needs to customize the return value. I just want to record and do not want to change the original result. Is there a way to return the original default, and when an exception occurs when debug = true, a debugging window is returned.
@app.errorhandler(Exception)
def exceptions(e):
if isinstance(e, HTTPException):
return e
logger.exception(e)
return InternalServerError()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone!
I used this decorator to record all exceptions in the app, but it seems that one needs to customize the return value. I just want to record and do not want to change the original result. Is there a way to return the original default, and when an exception occurs when debug = true, a debugging window is returned.
Beta Was this translation helpful? Give feedback.
All reactions