Propagating errors from Blueprint Error Handlers to App's Error Handlers #5699
Unanswered
Vimal-Kumar-V
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Re-raise the error from the blueprint's error handler. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a use case where I need to perform cleanup and rollback operations when a specific exception class is raised in any of the view functions registered to a particular Flask blueprint. After completing the cleanup, I want to propagate this exception to Flask's global error handler, which performs additional cleanup and formats the error response.
I am considering explicitly calling
app.handle_user_exception(exception)
, but this requires importing the entire app context into the utility layer, which seems unnecessary.Would appreciate any insights or best practices for handling such scenarios in Flask.
Beta Was this translation helpful? Give feedback.
All reactions