Skip to content

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Apr 26, 2024
1 parent acbdeca commit a258dc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion anemoi/utils/grib.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def _search(name):
raise KeyError(name)

if len(results) > 1:
raise ValueError(f"{name} is ambiguous")
names = [f'{r.get("id")} ({r.get("name")})' for r in results]
raise ValueError(f"{name} is ambiguous: {', '.join(names)}")

return results[0]

Expand Down

0 comments on commit a258dc0

Please sign in to comment.