Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better exception message for invalid JSON in hint distro file #2150

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,10 @@ def hint_dist_list() -> dict[str, str]:
dists = {}
for d in hint_dist_files():
with open(d, 'r') as dist_file:
dist = json.load(dist_file)
try:
dist = json.load(dist_file)
except json.JSONDecodeError as e:
raise ValueError(f'Could not parse hint distribution file {os.path.basename(d)!r}. Make sure the file is valid JSON or reach out to Support on Discord for help. Details: {e}') from e
dists[dist['name']] = dist['gui_name']
return dists

Expand Down