Skip to content
Myr

Merge pull request #1996 from untitaker/propagate-exceptions-werkzeug

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

Only passthrough_errors if PROPAGATE_EXCEPTIONS

authored by Markus Unterwaditzer · committed by GitHub · parents 71e10be, 098ea0c · Browse files · 3 files+5 added−4 removed
This commit

State

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

Diff stats

3 files+5 added−4 removed

  • tests:+2 added−2 removed
  • other:+3 added−2 removed

3 files+5 added−4 removed

modified:flask/app.py+2 added-1 removed
836 unmodified lines
837 if debug is not None:838 self.debug = bool(debug)839 options.setdefault('use_reloader', self.debug)840 options.setdefault('use_debugger', self.debug)841 options.setdefault('passthrough_errors', True)841 options.setdefault('passthrough_errors',842 self.config['PROPAGATE_EXCEPTIONS'])843 try:844 run_simple(host, port, self, **options)845 finally:846 # reset the first request information if the development server
1146 unmodified lines
modified:flask/cli.py+1 added-1 removed
428 unmodified lines
429 print(' * Forcing debug mode %s' % (debug and 'on' or 'off'))430431 run_simple(host, port, app, use_reloader=reload,432 use_debugger=debugger, threaded=with_threads,433 passthrough_errors=True)433 passthrough_errors=app.config['PROPAGATE_EXCEPTIONS'])434435436@click.command('shell', short_help='Runs a shell in the app context.')437@with_appcontext
75 unmodified lines
modified:tests/test_basic.py+2 added-2 removed
1266 unmodified lines
1267 app = flask.Flask(__name__)1268 monkeypatch.setattr(werkzeug.serving, 'run_simple', run_simple_mock)1269 app.config['PROPAGATE_EXCEPTIONS'] = propagate_exceptions1270 app.run(debug=debug, use_debugger=use_debugger, use_reloader=use_reloader)1271 # make sure werkzeug always passes errors through1272 assert rv['passthrough_errors']1271 # make sure werkzeug passes errors through if PROPAGATE_EXCEPTIONS1272 assert rv['passthrough_errors'] == propagate_exceptions127312741275def test_max_content_length():1276 app = flask.Flask(__name__)
386 unmodified lines