From: Harmon Date: Wed, 1 Jun 2022 13:26:08 +0000 (-0500) Subject: Log text of HTTP response when handling request error in BaseStream X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=598ea64d68ab3c27861e0f6dcf9bbce864dc3748;p=tweepy.git Log text of HTTP response when handling request error in BaseStream --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 9ff3746..041f3eb 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -100,6 +100,13 @@ class BaseStream: self.on_request_error(resp.status_code) if not self.running: break + # The error text is logged here instead of in + # on_request_error to keep on_request_error + # backwards-compatible. In a future version, the + # Response should be passed to on_request_error. + log.error( + "HTTP error response text: %s", resp.text + ) error_count += 1