Skip to content

Commit

Permalink
In DiscordWebhook.run print exception type in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Mar 24, 2024
1 parent 8856a6f commit f2eb159
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions avtdl/plugins/discord/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ async def run(self) -> None:
response = await self.session.post(self.hook_url, json=message)
text = await response.text()
except (OSError, asyncio.TimeoutError, aiohttp.ClientConnectionError) as e:
self.logger.warning(f'[{self.name}] error while sending message with Discord webhook: {e}, saving for the next try')
self.logger.warning(f'[{self.name}] error while sending message with Discord webhook: {e or type(e)}, saving for the next try')
until_next_try = 60
continue # implicitly saving messages in to_be_sent until the next try
except Exception as e:
self.logger.exception(f'[{self.name}] error while sending message with Discord webhook: {e}')
self.logger.exception(f'[{self.name}] error while sending message with Discord webhook: {e or type(e)}')
self.logger.debug(f'raw message text:\n{message}')
to_be_sent = pending_records # discard unsent messages as they might have been the cause of error
until_next_try = 60
Expand Down

0 comments on commit f2eb159

Please sign in to comment.