From f58032a71e7cbd7e6612228592036a4d70f0233d Mon Sep 17 00:00:00 2001 From: Michael Robinson Date: Tue, 21 Feb 2017 14:01:05 +0000 Subject: [PATCH 1/2] Catch the bad status line exception and log it --- lendingbot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lendingbot.py b/lendingbot.py index d30c931d..e8faf70a 100644 --- a/lendingbot.py +++ b/lendingbot.py @@ -4,6 +4,7 @@ import sys import time import traceback +from httplib import BadStatusLine from decimal import Decimal @@ -77,6 +78,8 @@ except KeyboardInterrupt: # allow existing the main bot loop raise + except BadStatusLine: + log.log_error("Caught BadStatusLine exception from Poloniex, ignoring.") except Exception as ex: log.log_error(ex.message) log.persistStatus() From d691695a955106ca1a99ae441d5fdf0311bcaee5 Mon Sep 17 00:00:00 2001 From: Michael Robinson Date: Tue, 21 Feb 2017 17:15:53 +0000 Subject: [PATCH 2/2] Move to main exception section --- lendingbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lendingbot.py b/lendingbot.py index e8faf70a..0a661eda 100644 --- a/lendingbot.py +++ b/lendingbot.py @@ -78,8 +78,6 @@ except KeyboardInterrupt: # allow existing the main bot loop raise - except BadStatusLine: - log.log_error("Caught BadStatusLine exception from Poloniex, ignoring.") except Exception as ex: log.log_error(ex.message) log.persistStatus() @@ -97,6 +95,8 @@ exit(1) elif 'timed out' in ex.message: print "Timed out, will retry in " + str(Lending.get_sleep_time()) + "sec" + elif isinstance(ex, BadStatusLine): + print "Caught BadStatusLine exception from Poloniex, ignoring." else: print traceback.format_exc() print "Unhandled error, please open a Github issue so we can fix it!"