forked from orbit-oss/flask
Do not handle RoutingExceptions with app error handlers
This commit is contained in:
parent
38a391815b
commit
b92b2e6c74
2 changed files with 13 additions and 1 deletions
|
|
@ -20,7 +20,8 @@ from threading import Lock
|
|||
from werkzeug.datastructures import Headers, ImmutableDict
|
||||
from werkzeug.exceptions import BadRequest, BadRequestKeyError, HTTPException, \
|
||||
InternalServerError, MethodNotAllowed, default_exceptions
|
||||
from werkzeug.routing import BuildError, Map, RequestRedirect, Rule
|
||||
from werkzeug.routing import BuildError, Map, RequestRedirect, \
|
||||
RoutingException, Rule
|
||||
|
||||
from . import cli, json
|
||||
from ._compat import integer_types, reraise, string_types, text_type
|
||||
|
|
@ -1638,6 +1639,12 @@ class Flask(_PackageBoundObject):
|
|||
if e.code is None:
|
||||
return e
|
||||
|
||||
# RoutingExceptions such as RequestRedirects are special exceptions
|
||||
# used to trigger routing actions such as redirects, and also behave
|
||||
# like proxy exceptions. We return these unchanged as well.
|
||||
if isinstance(e, RoutingException):
|
||||
return e
|
||||
|
||||
handler = self._find_error_handler(e)
|
||||
if handler is None:
|
||||
return e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue