aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-03-31 05:44:00 -0400
committerRapptz <[email protected]>2019-03-31 05:44:00 -0400
commitdea3ba5eb7c99f54c72b11f3e3f7b8f41649e779 (patch)
tree42ffb94659f6e90c11066c758dc94676f1dc2488 /discord/http.py
parentAdded functionality to edit user settings (diff)
downloaddiscord.py-dea3ba5eb7c99f54c72b11f3e3f7b8f41649e779.tar.xz
discord.py-dea3ba5eb7c99f54c72b11f3e3f7b8f41649e779.zip
Propagate Cloudflare 429 HTML text.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/http.py b/discord/http.py
index b103a7ef..4c270895 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