aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-05-03 17:57:30 -0400
committerRapptz <[email protected]>2020-07-25 09:59:40 -0400
commit137ff34f3ac69cbf652bc72d8f51c282010f72e0 (patch)
tree3a4ba43a1482f2d57ee7ee34312e8d53c09fa47e
parentHandle Connection Reset by Peer connection errors. (diff)
downloaddiscord.py-137ff34f3ac69cbf652bc72d8f51c282010f72e0.tar.xz
discord.py-137ff34f3ac69cbf652bc72d8f51c282010f72e0.zip
If we're out of retries just raise the OSError
-rw-r--r--discord/http.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/discord/http.py b/discord/http.py
index ceb6137a..4651490a 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -246,10 +246,9 @@ class HTTPClient:
# This is handling exceptions from the request
except OSError as e:
# Connection reset by peer
- if e.errno in (54, 10054):
- # Just re-do the request
+ if tries < 4 and e.errno in (54, 10054):
continue
-
+ raise
# We've run out of retries, raise.
raise HTTPException(r, data)