mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
logging_util: Error-proof against weird exc_info.
This commit is contained in:
committed by
Tim Abbott
parent
452a93f72b
commit
31ffe12873
@@ -3,6 +3,7 @@ import hashlib
|
|||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
|
from collections.abc import Iterable
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
from logging import Logger
|
from logging import Logger
|
||||||
@@ -79,7 +80,7 @@ class _RateLimitFilter:
|
|||||||
if rate > 0:
|
if rate > 0:
|
||||||
(use_cache, should_reset_handling_exception) = self.can_use_remote_cache()
|
(use_cache, should_reset_handling_exception) = self.can_use_remote_cache()
|
||||||
if use_cache:
|
if use_cache:
|
||||||
if record.exc_info is not None:
|
if record.exc_info is not None and isinstance(record.exc_info, Iterable):
|
||||||
tb = "\n".join(traceback.format_exception(*record.exc_info))
|
tb = "\n".join(traceback.format_exception(*record.exc_info))
|
||||||
else:
|
else:
|
||||||
tb = str(record)
|
tb = str(record)
|
||||||
|
Reference in New Issue
Block a user