From 598ea64d68ab3c27861e0f6dcf9bbce864dc3748 Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 1 Jun 2022 08:26:08 -0500 Subject: [PATCH] Log text of HTTP response when handling request error in BaseStream --- tweepy/streaming.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.25.1