aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorLilly Rose Berner <[email protected]>2021-07-09 10:54:22 +0200
committerGitHub <[email protected]>2021-07-09 04:54:22 -0400
commit0aa825557d97d2a065a33c755ece731631f2dfee (patch)
tree5340959af6bbd1561610c196425dc058b64f655b /discord/http.py
parentRefactor utcfromtimestamp to use fromtimestamp(..., tz=utc) (diff)
downloaddiscord.py-0aa825557d97d2a065a33c755ece731631f2dfee.tar.xz
discord.py-0aa825557d97d2a065a33c755ece731631f2dfee.zip
Re-try requests on 504 error and raise correct error
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/http.py b/discord/http.py
index c9c340ae..cc5ae967 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -321,8 +321,8 @@ class HTTPClient:
continue
- # we've received a 500 or 502, unconditional retry
- if response.status in {500, 502}:
+ # we've received a 500, 502, or 504, unconditional retry
+ if response.status in {500, 502, 504}:
await asyncio.sleep(1 + tries * 2)
continue
@@ -331,7 +331,7 @@ class HTTPClient:
raise Forbidden(response, data)
elif response.status == 404:
raise NotFound(response, data)
- elif response.status == 503:
+ elif response.status >= 500:
raise DiscordServerError(response, data)
else:
raise HTTPException(response, data)