fix(telegram): log network errors as warnings without stacktrace

This commit is contained in:
flobo3
2026-03-27 22:17:01 +08:00
committed by Xubin Ren
parent e464a81545
commit 5968b408dc
+5
View File
@@ -916,6 +916,11 @@ class TelegramChannel(BaseChannel):
async def _on_error(self, update: object, context: ContextTypes.DEFAULT_TYPE) -> None:
"""Log polling / handler errors instead of silently swallowing them."""
from telegram.error import NetworkError, TimedOut
if isinstance(context.error, (NetworkError, TimedOut)):
logger.warning("Telegram network issue: {}", str(context.error))
else:
logger.error("Telegram error: {}", context.error)
def _get_extension(