Skip to content

Commit

Permalink
map: Handle exception if no taxa found.
Browse files Browse the repository at this point in the history
  • Loading branch information
synrg committed Jun 15, 2024
1 parent fee7c21 commit 2d5d8f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inatcog/commands/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ async def map(self, ctx, *, taxa_list: Optional[str] = ""):
await ctx.send_help()
return

(taxa, missing_taxa) = await self.taxon_query.query_taxa(ctx, _taxa_list)
try:
(taxa, missing_taxa) = await self.taxon_query.query_taxa(ctx, _taxa_list)
except (BadArgument, LookupError) as err:
await apologize(ctx, str(err))
return
embed = await self.make_map_embed(ctx, taxa, missing_taxa)
await ctx.send(embed=embed)

Expand Down

0 comments on commit 2d5d8f2

Please sign in to comment.