From 4c03a2b504eda61dad792f042934d6569607b96e Mon Sep 17 00:00:00 2001 From: Wayne Moore Date: Sun, 16 May 2010 16:45:14 +0800 Subject: [PATCH] Runtime exception in listener no longer fails silently (Fixed issue #14). --- tweepy/streaming.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 0ea6436aa..261fb11e4 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -89,6 +89,7 @@ def _run(self): # enter loop error_counter = 0 conn = None + exception = None while self.running: if self.retry_count and error_counter > self.retry_count: # quit if error count greater than retry count @@ -114,7 +115,7 @@ def _run(self): break conn.close() sleep(self.snooze_time) - except Exception: + except Exception, exception: # any other exception is fatal, so kill loop break @@ -123,6 +124,9 @@ def _run(self): if conn: conn.close() + if exception: + raise exception + def _read_loop(self, resp): data = '' while self.running: