Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
sentry: Capture exceptions that happen during AdminNotifyHandler.
Alex Vandiver2f350c614b89
diff --git a/zerver/logging_handlers.py b/zerver/logging_handlers.pyindex bf0ca444bc7..24316b8f735 100644--- a/zerver/logging_handlers.py+++ b/zerver/logging_handlers.py@@ -10,6 +10,7 @@ from urllib.parse import SplitResultfrom django.conf import settingsfrom django.http import HttpRequestfrom django.views.debug import get_exception_reporter_filter+from sentry_sdk import capture_exceptionfrom typing_extensions import Protocol, runtime_checkablefrom version import ZULIP_VERSION@@ -142,6 +143,7 @@ class AdminNotifyHandler(logging.Handler):report['message'] = "Exception in preparing exception report!"logging.warning(report['message'], exc_info=True)report['stack_trace'] = "See /var/log/zulip/errors.log"+ capture_exception()if settings.DEBUG_ERROR_REPORTING: # nocoveragelogging.warning("Reporting an error to admins...")@@ -166,3 +168,4 @@ class AdminNotifyHandler(logging.Handler):# If this breaks, complain loudly but don't pass the traceback up the stream# However, we *don't* want to use logging.exception since that could trigger a loop.logging.warning("Reporting an exception triggered an exception!", exc_info=True)+ capture_exception()