Skip to content
Myr

Revert "Handle BaseExceptions (#2222)"

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

This reverts commit 1d4448abe335741c61b3c8c5f99e1607a13f7e3d.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 1d4448a · Browse files · 3 files+0 added−23 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+0 added−23 removed

  • tests:+0 added−17 removed
  • other:+0 added−6 removed

3 files+0 added−23 removed

modified:flask/app.py-3 removed
1989 unmodified lines
1990 response = self.full_dispatch_request()1991 except Exception as e:1992 error = e1993 response = self.handle_exception(e)1994 except:1995 error = sys.exc_info()[1]1996 raise1994 return response(environ, start_response)1995 finally:1996 if self.should_ignore_error(error):1997 error = None
11 unmodified lines
modified:tests/test_basic.py-17 removed
789 unmodified lines
790 assert resp.mimetype == 'text/x-special'791 assert resp.data == b'internal server error'792793794def test_baseexception_error_handling():795 app = flask.Flask(__name__)796 app.config['LOGGER_HANDLER_POLICY'] = 'never'797798 @app.route('/')799 def broken_func():800 raise KeyboardInterrupt()801802 with app.test_client() as c:803 with pytest.raises(KeyboardInterrupt):804 c.get('/')805806 ctx = flask._request_ctx_stack.top807 assert ctx.preserved808 assert type(ctx._preserved_exc) is KeyboardInterrupt809810794def test_before_request_and_routing_errors():795 app = flask.Flask(__name__)796797 @app.before_request
903 unmodified lines
modified:CHANGES-3 removed
12 unmodified lines
13 was confusing to debug for newcomers.14- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()15 method returns compressed response by default, and pretty response in16 debug mode.17- Call `ctx.auto_pop` with the exception object instead of `None`, in the18 event that a `BaseException` such as `KeyboardInterrupt` is raised in a19 request handler.1718Version 0.12.119--------------20
605 unmodified lines