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

Make the missing-file warning less alarming when loading JSON data #372

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

chrisib
Copy link
Collaborator

@chrisib chrisib commented Jul 21, 2024

Currently if the JSON configuration file is missing for any of europi_config, experimental_config, or any individual script that uses the configuration.ConfigPoint implementation, the user will see an error message like this:

Unable to read JSON data from config/EuroPiConfig.json: [Errno 2] ENOENT
Unable to read JSON data from config/ExperimentalConfig.json: [Errno 2] ENOENT

This can cause confusion for users, since it looks like it's an error they need to correct, when in fact they're just opting not to define a customization file to override the default settings. This MR handles errno.ENOENT ("no entity") so instead the user will see

/config/EuroPiConfig.json does not exist. Using default settings
/config/ExperimentalConfig.json does not exist. Using default settings

I considered just swallowing that error and not printing anything, but I think it's important to show that the file is failing to load just in case the user is trying to override something and e.g. accidentally put the file in the wrong directory or has an invalid capitalization inside the filename.

All other errors are handled as they are now, as those probably are bugs that should be addressed.

@chrisib chrisib added firmware Software related issue improvement Improvement or optimization of an existing feature or script labels Jul 21, 2024
Copy link
Collaborator

@awonak awonak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the usability improvement!

@awonak awonak merged commit b3035e0 into Allen-Synthesis:main Aug 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firmware Software related issue improvement Improvement or optimization of an existing feature or script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants