Skip to content

Commit

Permalink
Propagate Cloudflare 429 HTML text.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Mar 31, 2019
1 parent 4ec7213 commit dea3ba5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions discord/http.py
Expand Up @@ -181,6 +181,10 @@ async def request(self, route, *, files=None, header_bypass_delay=None, **kwargs

# 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
Expand Down

0 comments on commit dea3ba5

Please sign in to comment.