mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Fixes with fail states
This commit is contained in:
parent
d520a633c6
commit
0b25f6af2c
|
@ -154,8 +154,9 @@ class MessageQueue:
|
||||||
status = await send_to_discord_webhook(msg, webhook_url, method)
|
status = await send_to_discord_webhook(msg, webhook_url, method)
|
||||||
except aiohttp.ClientError:
|
except aiohttp.ClientError:
|
||||||
client_error = True
|
client_error = True
|
||||||
except (aiohttp.ServerConnectionError, aiohttp.ServerTimeoutError):
|
except (aiohttp.ServerConnectionError, aiohttp.ServerTimeoutError, asyncio.TimeoutError):
|
||||||
# Retry on next Discord message sent attempt
|
# 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
|
return
|
||||||
except ExhaustedDiscordBucket as e:
|
except ExhaustedDiscordBucket as e:
|
||||||
if e.is_global:
|
if e.is_global:
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ClientError(Exception):
|
||||||
"""Exception for when a request failes because of Client error"""
|
"""Exception for when a request failes because of Client error"""
|
||||||
|
|
||||||
def __init__(self, request):
|
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)
|
super().__init__(self.message)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue