mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
decorator: Drop the stack_info on most WebhookErrors.
`stack_info` shows the stack between where the error was raised and where it was captured -- which is not interesting when we intentionally raised it, and know where it will be captured. Omit the `stack_info` when it will just fill the logs with uninteresting data.
This commit is contained in:
committed by
Tim Abbott
parent
05d8c9d49e
commit
869f96e31b
@@ -312,10 +312,13 @@ def log_unsupported_webhook_event(request: HttpRequest, summary: str) -> None:
|
||||
|
||||
def log_exception_to_webhook_logger(request: HttpRequest, err: Exception) -> None:
|
||||
extra = {"request": request}
|
||||
# We intentionally omit the stack_info for these events, where
|
||||
# they are intentionally raised, and the stack_info between that
|
||||
# point and this one is not interesting.
|
||||
if isinstance(err, AnomalousWebhookPayloadError):
|
||||
webhook_anomalous_payloads_logger.exception(err, stack_info=True, extra=extra)
|
||||
webhook_anomalous_payloads_logger.exception(err, extra=extra)
|
||||
elif isinstance(err, UnsupportedWebhookEventTypeError):
|
||||
webhook_unsupported_events_logger.exception(err, stack_info=True, extra=extra)
|
||||
webhook_unsupported_events_logger.exception(err, extra=extra)
|
||||
else:
|
||||
webhook_logger.exception(err, stack_info=True, extra=extra)
|
||||
|
||||
|
Reference in New Issue
Block a user