Merge remote-tracking branch 'origin/v1.6.9' into v1.6.9

pull/98/head
Rilliat 2025-02-09 16:17:55 +03:00
commit 74bc26511d
1 changed files with 3 additions and 2 deletions

View File

@ -21,6 +21,7 @@ from logging.handlers import RotatingFileHandler
import herokutl
from aiogram.utils.exceptions import NetworkError
from herokutl.errors import PersistentTimestampOutdatedError
from . import utils
from .tl_cache import CustomTelegramClient
@ -66,9 +67,9 @@ linecache.getlines = getlines
def override_text(exception: Exception) -> typing.Optional[str]:
"""Returns error-specific description if available, else `None`"""
if isinstance(exception, NetworkError):
if isinstance(exception, (NetworkError, asyncio.exceptions.TimeoutError)):
return "✈️ <b>You have problems with internet connection on your server.</b>"
if 'Telegram is having internal issues' in str(exception):
elif isinstance(exception, PersistentTimestampOutdatedError):
return "✈️ <b>Telegram has problems with their datacenters.</b>"
return None