From: Wayne Moore Date: Sun, 16 May 2010 08:45:14 +0000 (+0800) Subject: Runtime exception in listener no longer fails silently (Fixed issue #14). X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4c03a2b504eda61dad792f042934d6569607b96e;p=tweepy.git Runtime exception in listener no longer fails silently (Fixed issue #14). --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 0ea6436..261fb11 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -89,6 +89,7 @@ class Stream(object): # 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 @@ class Stream(object): 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 @@ class Stream(object): if conn: conn.close() + if exception: + raise exception + def _read_loop(self, resp): data = '' while self.running: