Fixes with fail states

This commit is contained in:
Frisk 2024-04-03 16:01:49 +02:00
parent d520a633c6
commit 0b25f6af2c
2 changed files with 3 additions and 2 deletions

View file

@ -154,8 +154,9 @@ class MessageQueue:
status = await send_to_discord_webhook(msg, webhook_url, method)
except aiohttp.ClientError:
client_error = True
except (aiohttp.ServerConnectionError, aiohttp.ServerTimeoutError):
except (aiohttp.ServerConnectionError, aiohttp.ServerTimeoutError, asyncio.TimeoutError):
# Retry on next Discord message sent attempt
logger.debug(f"Received timeout or connection error when sending a Discord message for {msg.wiki.script_url}.")
return
except ExhaustedDiscordBucket as e:
if e.is_global:

View file

@ -44,7 +44,7 @@ class ClientError(Exception):
"""Exception for when a request failes because of Client error"""
def __init__(self, request):
self.message = f"Client have made wrong request! {request.status_code}: {request.reason}. {request.text}"
self.message = f"Client have made wrong request! {request.status}: {request.reason}."
super().__init__(self.message)