From 49a8775f02ae11bfb1e4fac5ea91f7702932edfb Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 21 Jan 2021 04:11:21 -0600 Subject: [PATCH] Rename AsyncStream.on_http_error to on_request_error --- tweepy/asynchronous/streaming.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tweepy/asynchronous/streaming.py b/tweepy/asynchronous/streaming.py index 7433cf6..2ca7506 100644 --- a/tweepy/asynchronous/streaming.py +++ b/tweepy/asynchronous/streaming.py @@ -110,7 +110,7 @@ class AsyncStream: await self.on_closed(resp) else: - await self.on_http_error(resp.status) + await self.on_request_error(resp.status) error_count += 1 @@ -259,19 +259,19 @@ class AsyncStream: """ log.exception("Stream encountered an exception") - async def on_http_error(self, status_code): + async def on_keep_alive(self): """This method is a coroutine. - This is called when a non-200 HTTP status code is encountered. + This is called when a keep-alive message is received. """ - log.error(f"Stream encountered HTTP Error: {status_code}") + log.debug("Received keep-alive message") - async def on_keep_alive(self): + async def on_request_error(self, status_code): """This method is a coroutine. - This is called when a keep-alive message is received. + This is called when a non-200 HTTP status code is encountered. """ - log.debug("Received keep-alive message") + log.error(f"Stream encountered HTTP Error: {status_code}") async def on_data(self, raw_data): """This method is a coroutine. -- 2.25.1