Skip to content
Myr

simplify BadRequestKeyError.show_exception

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 14f5636 · Browse files · 1 file+4 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−11 removed

  • other:+4 added−11 removed

1 file+4 added−11 removed

modified:src/flask/app.py+4 added-11 removed
1384 unmodified lines
1385 message.13861387 .. versionadded:: 0.71388 """1389 if isinstance(e, BadRequestKeyError):1390 if self.debug or self.config["TRAP_BAD_REQUEST_ERRORS"]:1391 e.show_exception = True1389 if isinstance(e, BadRequestKeyError) and (1390 self.debug or self.config["TRAP_BAD_REQUEST_ERRORS"]1391 ):1392 e.show_exception = True13931393 # Werkzeug < 0.15 doesn't add the KeyError to the 4001394 # message, add it in manually.1395 # TODO: clean up once Werkzeug >= 0.15.5 is required1396 if e.args[0] not in e.get_description():1397 e.description = f"KeyError: {e.args[0]!r}"1398 elif not hasattr(BadRequestKeyError, "show_exception"):1399 e.args = ()14001394 if isinstance(e, HTTPException) and not self.trap_http_exception(e):1395 return self.handle_http_exception(e)13961397 handler = self._find_error_handler(e)
638 unmodified lines