Print twitter errors
authorLukas Pohlreich <pohlreichlukas@gmail.com>
Wed, 22 Oct 2014 10:18:02 +0000 (12:18 +0200)
committerLukas Pohlreich <pohlreichlukas@gmail.com>
Wed, 22 Oct 2014 10:20:52 +0000 (12:20 +0200)
rainbowstream/rainbow.py

index 2b8a456571c676bbd477b1dee2d4a16ddf41171f..7480e2a566402399f9c5236187c131cb6594da13 100644 (file)
@@ -27,6 +27,7 @@ from .interactive import *
 from .c_image import *
 from .py3patch import *
 from .emoji import *
 from .c_image import *
 from .py3patch import *
 from .emoji import *
+from .util import printTwitterErrors
 
 # Global values
 g = {}
 
 # 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)
             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 :("))
         printNicely('')
         printNicely(
             magenta("We have maximum connection problem with twitter'stream API right now :("))
+        printTwitterErrors(e)
 
 
 def fly():
 
 
 def fly():
@@ -2074,10 +2076,11 @@ def fly():
         proxy_connect(args)
         init(args)
     # Twitter API connection problem
         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 :("))
         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()
         printNicely(magenta("Let's try again later."))
         save_history()
         sys.exit()