Skip to content

Commit 52c66c5

Browse files
committed
Handle missing mission filenames in /zeus-set-mission
1 parent 3b1ee17 commit 52c66c5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/zeusops_bot/cogs/zeus_upload.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ async def zeus_upload(
5353
@commands.slash_command(name="zeus-set-mission")
5454
async def zeus_set_mission(self, ctx: discord.ApplicationContext, filename: str):
5555
"""Activate the given a mission file as a Zeus"""
56-
await ctx.respond(f"Setting mission to {filename=}")
57-
self.reforger_confgen.zeus_set_mission(filename)
56+
try:
57+
self.reforger_confgen.zeus_set_mission(filename)
58+
await ctx.respond(f"Setting mission to {filename=}")
59+
except ConfigFileNotFound:
60+
await ctx.respond(f"Error: could not find mission '{filename}'")
5861

5962
@commands.slash_command(name="zeus-list")
6063
async def zeus_list(self, ctx: discord.ApplicationContext):

0 commit comments

Comments
 (0)