Skip to content

Allow default Errorhandler for HTTPException - #2144

Closed
sumpfgottheit wants to merge 1 commit into
pallets:masterfrom
sumpfgottheit:default_error_handler
Closed

sumpfgottheit wants to merge 1 commit into
pallets:masterfrom
sumpfgottheit:default_error_handler

Conversation

@sumpfgottheit

Copy link
Copy Markdown
Contributor

Allow an default errorhandler for all HTTPException.

This will come handy when building a REST API where you want all Errors return JSON instead of the default behaviour.

PR #2082 solves the same problem, but it didn't work in my environment. Tests are included.

Allow a default errorhandler by registering
an errorhandler for HTTPException

tests included
cerickson added a commit to cerickson/flask that referenced this pull request May 22, 2017
Error handlers are now returned in order of blueprint:code, app:code,
blueprint:HTTPException, app:HTTPException, None

Corresponding tests also added.

Ref issue pallets#941, pr pallets#1383, pallets#2082, pallets#2144
@jeffwidman

Copy link
Copy Markdown
Contributor

Thanks for this! Closing in favor of the #2304 which takes this and extends it.

@jeffwidman jeffwidman closed this May 23, 2017
cerickson added a commit to cerickson/flask that referenced this pull request May 23, 2017
Error handlers are now returned in order of blueprint:code, app:code,
blueprint:HTTPException, app:HTTPException, None

Corresponding tests also added.

Ref issue pallets#941, pr pallets#1383, pallets#2082, pallets#2144
cerickson added a commit to cerickson/flask that referenced this pull request May 23, 2017
Error handlers are now returned in order of blueprint:code, app:code,
blueprint:HTTPException, app:HTTPException, None

Corresponding tests also added.

Ref issue pallets#941, pr pallets#1383, pallets#2082, pallets#2144
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants