From de85c34462a7320bbc75127c8abf7a43fd1167f8 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 23 Jul 2019 21:12:08 +0200 Subject: [PATCH] Handle connection error when fetching difference in updates --- telethon/client/updates.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index 4a9cb2b3..47e18175 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -378,7 +378,10 @@ class UpdateMethods: if self._state_cache.update(update, check_only=True): # If the update doesn't have pts, fetching won't do anything. # For example, UpdateUserStatus or UpdateChatUserTyping. - await self._get_difference(update, channel_id, pts_date) + try: + await self._get_difference(update, channel_id, pts_date) + except OSError: + pass # We were disconnected, that's okay built = EventBuilderDict(self, update, others) for conv_set in self._conversations.values():