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

Conversation

fenhl
Copy link
Collaborator

@fenhl fenhl commented Dec 14, 2023

A user of my fork DM'd me today because they had run into an issue where the randomizer showed this error message:

json.decoder.JSONDecodeError: Expecting value: line 25 column 5 (char 1556)

The problem was a syntax error in one of their custom hint distribution files. The error message does not mention this; you need to read the traceback to find the cause of the issue. This PR changes the error message to the following:

ValueError: Could not parse hint distribution file 'syntax_error.json'. Make sure the file is valid JSON or reach out to Support on Discord for help. Details: Expecting value: line 25 column 5 (char 1556)

This can be tested by placing a hint distribution that's not valid JSON (e.g. an empty file) into data/Hints.

@fenhl fenhl added Component: Hints related to how we help the player Component: Documentation Affects user-facing help messages or public API docs labels Dec 14, 2023
@fenhl fenhl merged commit e9574b8 into OoTRandomizer:Dev Jan 25, 2024
3 checks passed
@fenhl fenhl deleted the hint-distro-error-msg branch March 17, 2024 07:21
@fenhl fenhl added this to the 8.1 milestone Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Affects user-facing help messages or public API docs Component: Hints related to how we help the player
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant