-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a optional config variable to disable centralized error handler in recovery middleware #2410
Conversation
Should I pass back the error with closure, so upstream middlewares can handle ? |
I have returned back the error, seems like that should be the ideal behavior, also added corrected tests |
…r is only returned back if centralized error handler is disabled, improved test cases
Codecov ReportBase: 92.84% // Head: 92.85% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2410 +/- ##
=======================================
Coverage 92.84% 92.85%
=======================================
Files 39 39
Lines 4503 4507 +4
=======================================
+ Hits 4181 4185 +4
Misses 234 234
Partials 88 88
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
For history sake - not returning error by default bothers me as it would be more correct behavior. But this would make middleware behave completely different as it has done since 2015. These simple things can be problematic as it changes how already existing application middleware chain work. Probably 98% time this is not an issue - but for some it could be. life is about making compromises. p.s. just looked my |
Recovery Middleware calls the centralized Error Handler. This is a change to have a optional config variable to disable centralized error handler in recovery. If the centrailzed Error Handler is disabled, panic error caught, will be returned to upstream middleware.