Check error handlers for specific classes first
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This allows adding error handlers like this: @app.errorhandler(werkzeug.exceptions.Forbidden) And subclassing HTTPExceptions: class ForbiddenBecauseReason(Forbidden): pass @app.errorhandler(ForbiddenBecauseReason) def error1(): return "Forbidden because reason", 403 @app.errorhandler(403) def error2(): return "Forbidden", 403 ... the idea being, that a flask extension might want to raise an exception, with the default behaviour of creating a HTTP error page, but still allowing the user to add a view/handler specific to that exception (e.g., "Forbidden because you are not in the right group").
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+49 added−3 removed
- other:+49 added−3 removed