mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-08 10:06:41 +00:00
Except IOError and not ConnectionError
PySocks' errors do not subclass ConnectionError so the library was unnecessarily logging them as unexpected, when any IOError was actually expected.
This commit is contained in:
@@ -115,7 +115,10 @@ class InteractiveTelegramClient(TelegramClient):
|
||||
print('Connecting to Telegram servers...')
|
||||
try:
|
||||
loop.run_until_complete(self.connect())
|
||||
except ConnectionError:
|
||||
except IOError:
|
||||
# We handle IOError and not ConnectionError because
|
||||
# PySocks' errors do not subclass ConnectionError
|
||||
# (so this will work with and without proxies).
|
||||
print('Initial connection failed. Retrying...')
|
||||
loop.run_until_complete(self.connect())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user