flask-smorest
flask-smorest copied to clipboard
Reasoning for Errorhandlers on the API vs Blueprint
Currently the errorhandlers are added on a application basis via the ErrorHandlerMixin on the API class. Flask also allows to define the error handlers on the Blueprint level. What is the reasoning to use application level error handlers?
I can see the following pros/cons:
Pro:
- Simplicity: single registration on the application level
- Handling of unknown routes
Con:
- Can hide user defined error handlers or can be hidden by user defined handlers.
- Also applies to non API Routes
- Currently no mention in the docs that the handlers are registered on the application level.
Hi. Thanks for the constructive feedback. I'm pretty busy these days so I can't promise I'll provide quick answers.
This was partly discussed in #51. I closed the issue back then but I'm open to reconsidering.
No problem. I'm just evaluating flask-smorest at the moment, comming from something self made. During the migration phase it would be nice if the error handlers just intercepts the errors on the new API.