From 0b25f6af2c731515d2742207156d020fdad72762 Mon Sep 17 00:00:00 2001 From: Frisk Date: Wed, 3 Apr 2024 16:01:49 +0200 Subject: [PATCH] Fixes with fail states --- src/discord/queue.py | 3 ++- src/exceptions.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/discord/queue.py b/src/discord/queue.py index c94026d..056c77c 100644 --- a/src/discord/queue.py +++ b/src/discord/queue.py @@ -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: diff --git a/src/exceptions.py b/src/exceptions.py index 2c46fb5..c5f6d2f 100644 --- a/src/exceptions.py +++ b/src/exceptions.py @@ -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)