Skip to content

Commit

Permalink
catch the error in the unhandled error catcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasByr committed Sep 10, 2023
1 parent f226b3e commit 00795cc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,16 @@ async def on_app_command_error(self, interaction: discord.Interaction, error: Ex
f'{FAIL_EMOJI} Please let an admin know about this issue : \n```py\n{error.with_traceback(None)}\n```',
)
if not embed:
self.log.critical('Panic while handling slash command unhandled exception !')
self.log.critical('Panic while handling slash command unhandled exception: embed is empty')
sys.exit(1)
await self.dispatcher.reply_with_embed(interaction, embed)

try:
await self.dispatcher.reply_with_embed(interaction, embed)

except Exception as e: # pylint: disable=broad-except

self.log.critical('Panic while sending slash command unhandled exception: %s\n\n%s\n%s', e, embed.title,
embed.description)

def on_end(self, sig: int, _: Any) -> None:
"""
Expand Down

0 comments on commit 00795cc

Please sign in to comment.