aboutsummaryrefslogtreecommitdiff
path: root/discord/webhook.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/webhook.py')
-rw-r--r--discord/webhook.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/webhook.py b/discord/webhook.py
index 7824c55a..bd280230 100644
--- a/discord/webhook.py
+++ b/discord/webhook.py
@@ -34,7 +34,7 @@ from urllib.parse import quote as _uriquote
import aiohttp
from . import utils
-from .errors import InvalidArgument, HTTPException, Forbidden, NotFound
+from .errors import InvalidArgument, HTTPException, Forbidden, NotFound, DiscordServerError
from .enums import try_enum, WebhookType
from .user import BaseUser, User
from .asset import Asset
@@ -241,7 +241,10 @@ class AsyncWebhookAdapter(WebhookAdapter):
raise NotFound(r, response)
else:
raise HTTPException(r, response)
+
# no more retries
+ if r.status >= 500:
+ raise DiscordServerError(r, response)
raise HTTPException(r, response)
async def handle_execution_response(self, response, *, wait):
@@ -342,7 +345,10 @@ class RequestsWebhookAdapter(WebhookAdapter):
raise NotFound(r, response)
else:
raise HTTPException(r, response)
+
# no more retries
+ if r.status >= 500:
+ raise DiscordServerError(r, response)
raise HTTPException(r, response)
def handle_execution_response(self, response, *, wait):