Handle CancelledError inside update loop

This error is not really unexpected, since the library uses it to
cancel the task during disconnect.

Closes #3921.
This commit is contained in:
Lonami Exo 2022-09-14 17:11:13 +02:00
parent 7d4424ac2b
commit 50aa92ebde

View File

@ -351,6 +351,8 @@ class UpdateMethods:
continue # get(_channel)_difference will start returning requests
updates_to_dispatch.extend(self._preprocess_updates(processed, users, chats))
except asyncio.CancelledError:
pass
except Exception:
self._log[__name__].exception('Fatal error handling updates (this is a bug in Telethon, please report it)')