Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passthrough exceptions in TESTING mode #146

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions flask/app.py
Expand Up @@ -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,
Expand Down