From 516a2e743583453384901b424c0d4fc1b41d118a Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 12 Mar 2023 17:46:25 +0100 Subject: [PATCH] Handle timeout error during getDifference Closes #4043. --- telethon/client/updates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index 3a39a8ba..157d1f47 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -285,7 +285,7 @@ class UpdateMethods: self._log[__name__].debug('Getting difference for account updates') try: diff = await self(get_diff) - except (errors.ServerError, ValueError) as e: + except (errors.ServerError, errors.TimeoutError, ValueError) as e: # Telegram is having issues self._log[__name__].info('Cannot get difference since Telegram is having issues: %s', type(e).__name__) self._message_box.end_difference() @@ -338,6 +338,7 @@ class UpdateMethods: errors.PersistentTimestampOutdatedError, errors.PersistentTimestampInvalidError, errors.ServerError, + errors.TimeoutError, ValueError ) as e: # According to Telegram's docs: