mirror of
https://github.com/zulip/zulip.git
synced 2025-10-27 10:03:56 +00:00
middleware: Pass unhandled API exceptions through to the test suite.
This results in more useful stack traces in failing tests. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
2b35abba5d
commit
345ed1d09d
@@ -478,7 +478,7 @@ class JsonErrorHandler(MiddlewareMixin):
|
||||
|
||||
if isinstance(exception, JsonableError):
|
||||
return json_response_from_error(exception)
|
||||
if RequestNotes.get_notes(request).error_format == "JSON":
|
||||
if RequestNotes.get_notes(request).error_format == "JSON" and not settings.TEST_SUITE:
|
||||
capture_exception(exception)
|
||||
json_error_logger = logging.getLogger("zerver.middleware.json_error_handler")
|
||||
json_error_logger.error(traceback.format_exc(), extra=dict(request=request))
|
||||
|
||||
Reference in New Issue
Block a user