From f984aae391b422dc81ae5ff9e79bbcfd63b77bc4 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 9 Oct 2017 11:37:08 +0200 Subject: [PATCH] Except ProxyConnectionError on ReadThread (fix #307) --- telethon/telegram_bare_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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.