mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-03 09:52:33 +00:00
fix(telegram): log network errors as warnings without stacktrace
This commit is contained in:
parent
e464a81545
commit
5968b408dc
@ -916,7 +916,12 @@ class TelegramChannel(BaseChannel):
|
||||
|
||||
async def _on_error(self, update: object, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
"""Log polling / handler errors instead of silently swallowing them."""
|
||||
logger.error("Telegram error: {}", context.error)
|
||||
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(
|
||||
self,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user