diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index b98ef976..2447a67d 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -811,7 +811,8 @@ class TelegramBareClient: try: import socks - if isinstance(error, socks.GeneralProxyError): + if isinstance(error, socks.GeneralProxyError) or \ + isinstance(error, socks.ProxyConnectionError): # This is a known error, and it's not related to # Telegram but rather to the proxy. Disconnect and # hand it over to the main thread.