Merge branch '1.0.x'
This commit is contained in:
commit
2a2134974c
2 changed files with 420 additions and 410 deletions
820
CHANGES.rst
820
CHANGES.rst
File diff suppressed because it is too large
Load diff
|
|
@ -1797,14 +1797,14 @@ class Flask(_PackageBoundObject):
|
||||||
|
|
||||||
if isinstance(e, BadRequestKeyError):
|
if isinstance(e, BadRequestKeyError):
|
||||||
if self.debug or self.config["TRAP_BAD_REQUEST_ERRORS"]:
|
if self.debug or self.config["TRAP_BAD_REQUEST_ERRORS"]:
|
||||||
|
e.show_exception = True
|
||||||
|
|
||||||
# Werkzeug < 0.15 doesn't add the KeyError to the 400
|
# Werkzeug < 0.15 doesn't add the KeyError to the 400
|
||||||
# message, add it in manually.
|
# message, add it in manually.
|
||||||
description = e.get_description()
|
# TODO: clean up once Werkzeug >= 0.15.5 is required
|
||||||
|
if e.args[0] not in e.get_description():
|
||||||
if e.args[0] not in description:
|
|
||||||
e.description = "KeyError: '{}'".format(*e.args)
|
e.description = "KeyError: '{}'".format(*e.args)
|
||||||
else:
|
elif not hasattr(BadRequestKeyError, "show_exception"):
|
||||||
# Werkzeug >= 0.15 does add it, remove it in production
|
|
||||||
e.args = ()
|
e.args = ()
|
||||||
|
|
||||||
if isinstance(e, HTTPException) and not self.trap_http_exception(e):
|
if isinstance(e, HTTPException) and not self.trap_http_exception(e):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue