Catch fatal errors and kill stream loop.
authorJosh Roesslein <jroesslein@gmail.com>
Sat, 8 Aug 2009 07:08:26 +0000 (02:08 -0500)
committerJosh Roesslein <jroesslein@gmail.com>
Sat, 8 Aug 2009 07:08:26 +0000 (02:08 -0500)
tweepy/streaming.py

index fd2b1118e6519bb406788ef50003d9cd87e6a133..2b9491fc0749c14b532d9ccf2946b6035035eb57 100644 (file)
@@ -47,6 +47,10 @@ class Stream(object):
       except timeout:
         conn.close()
         continue
+      except Exception:
+        # any other exception is fatal, so kill loop
+        self.running = False
+        break
 
     # cleanup
     conn.close()