Skip to content

Commit 3b1ee17

Browse files
committed
Add a generic error handler for slash commands
1 parent c0f4531 commit 3b1ee17

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/zeusops_bot/cogs/zeus_upload.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@ async def current_mission(self, ctx: discord.ApplicationContext):
7575
)
7676
except ConfigFileNotFound as e:
7777
await ctx.respond(f"Could not find configured mission: {str(e)}")
78+
79+
@commands.Cog.listener()
80+
async def on_application_command_error(
81+
self, ctx: discord.ApplicationContext, error: discord.DiscordException
82+
):
83+
"""Handles application command errors that are not caught elsewhere"""
84+
await ctx.respond(f"Unhandled exception: {error}")

0 commit comments

Comments
 (0)