From a1354601c3c89ebf62799f05a05e081267f8d713 Mon Sep 17 00:00:00 2001 From: Michael Elsdoerfer Date: Mon, 22 Nov 2010 00:13:01 +0100 Subject: [PATCH] Also passthrough errors when TESTING is set. --- flask/app.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flask/app.py b/flask/app.py index f2ec45e93b..c24be8176a 100644 --- a/flask/app.py +++ b/flask/app.py @@ -673,16 +673,17 @@ def handle_http_exception(self, e): def handle_exception(self, e): """Default exception handling that kicks in when an exception - occours that is not catched. In debug mode the exception will - be re-raised immediately, otherwise it is logged and the handler - for a 500 internal server error is used. If no such handler - exists, a default 500 internal server error message is displayed. + occours that is not catched. In debug or testing mode the + exception will be re-raised immediately, otherwise it is logged + and the handler for a 500 internal server error is used. + If no such handler exists, a default 500 internal server error + message is displayed. .. versionadded: 0.3 """ got_request_exception.send(self, exception=e) handler = self.error_handlers.get(500) - if self.debug: + if self.debug or self.testing: raise self.logger.exception('Exception on %s [%s]' % ( request.path,