Rename StreamListener.on_error to on_request_error
authorHarmon <Harmon758@gmail.com>
Thu, 21 Jan 2021 01:41:34 +0000 (19:41 -0600)
committerHarmon <Harmon758@gmail.com>
Thu, 21 Jan 2021 01:41:34 +0000 (19:41 -0600)
tweepy/streaming.py

index 7104000deaee9dbcbedf1c1429c5cf80aa38e163..10012c2442cd4edd16894baedfa8fb653c84a958 100644 (file)
@@ -86,7 +86,7 @@ class StreamListener:
         """Called when a limitation notice arrives"""
         return
 
-    def on_error(self, status_code):
+    def on_request_error(self, status_code):
         """Called when a non-200 status code is returned"""
         return False
 
@@ -233,7 +233,7 @@ class Stream:
                                                 verify=self.verify,
                                                 proxies=self.proxies)
                     if resp.status_code != 200:
-                        if self.listener.on_error(resp.status_code) is False:
+                        if self.listener.on_request_error(resp.status_code) is False:
                             break
                         error_counter += 1
                         if resp.status_code == 420: