From dea3ba5eb7c99f54c72b11f3e3f7b8f41649e779 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 31 Mar 2019 05:44:00 -0400 Subject: [PATCH] Propagate Cloudflare 429 HTML text. --- discord/http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discord/http.py b/discord/http.py index b103a7ef2..4c270895b 100644 --- a/discord/http.py +++ b/discord/http.py @@ -181,6 +181,10 @@ class HTTPClient: # we are being rate limited if r.status == 429: + if not isinstance(data, dict): + # Banned by Cloudflare more than likely. + raise HTTPException(r, data) + fmt = 'We are being rate limited. Retrying in %.2f seconds. Handled under the bucket "%s"' # sleep a bit