From 10451509f1ffd096cad16ff56199b599645c7c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Thu, 12 Nov 2015 19:15:39 +0100 Subject: [PATCH] fix for issue #79 --- telegram/utils/request.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telegram/utils/request.py b/telegram/utils/request.py index 87ccccc4c..430d98482 100644 --- a/telegram/utils/request.py +++ b/telegram/utils/request.py @@ -110,7 +110,11 @@ def post(url, if error.getcode() == 502: raise TelegramError('Bad Gateway') - message = _parse(error.read()) + try: + message = _parse(error.read()) + except ValueError: + message = 'Unknown HTTPError' + raise TelegramError(message) except (SSLError, socket.timeout) as error: if "operation timed out" in str(error):