From 742266f882369a1a617aebc63190c7a61ba7815a Mon Sep 17 00:00:00 2001 From: Lukas Pohlreich Date: Wed, 22 Oct 2014 12:18:02 +0200 Subject: [PATCH] Print twitter errors --- rainbowstream/rainbow.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 2b8a456..7480e2a 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -27,6 +27,7 @@ from .interactive import * from .c_image import * from .py3patch import * from .emoji import * +from .util import printTwitterErrors # Global values g = {} @@ -2058,10 +2059,11 @@ def stream(domain, args, name='Rainbow Stream'): elif tweet.get('event'): c['events'].append(tweet) print_event(tweet) - except TwitterHTTPError: + except TwitterHTTPError as e: printNicely('') printNicely( magenta("We have maximum connection problem with twitter'stream API right now :(")) + printTwitterErrors(e) def fly(): @@ -2074,10 +2076,11 @@ def fly(): proxy_connect(args) init(args) # Twitter API connection problem - except TwitterHTTPError: + except TwitterHTTPError as e: printNicely('') printNicely( magenta("We have connection problem with twitter'stream API right now :(")) + printTwitterErrors(e) printNicely(magenta("Let's try again later.")) save_history() sys.exit() -- 2.25.1