-
Notifications
You must be signed in to change notification settings - Fork 39
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
Bad configuration files are silently ignored #84
Comments
I just made a simple fix for this in master...hhromic:eget:feat-cfg-errors Using the above example bad config file,
I think this is much better UX than silently ignoring errors and loading the defaults. |
Sounds good to fix. You can open a PR, I'll make a few comments and then merge when fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While configuring
eget
using a file, by mistake I used an array for thefile
config for one repository block which madeeget
silently ignore the whole file. I got puzzled for a long time on whyeget
started to simply forge/ignore all my previously working configuration until I realized the mistake (file
must be a string, not an array of strings).Looking at the source code, I see that the
InitializeConfig()
function probes different configuration files and locations until it finds a working file, falling back to default settings if none are found.While the above is as designed and expected, I think
eget
should only move on to try the next file candidate if and only if the current candidate does not exist. Any other errors such as TOML parsing should be reported and the application stopped instead of silently being discarded and the probing moving on.If you agree, I am happy to submit a PR with this change so users can easily spot unintended configuration errors.
EDIT: For completeness, here is an example valid TOML file with a slightly invalid
eget
configuration that is silently ignored and, if it is the only configuration file available, silently falls back to the defaults for everything:The text was updated successfully, but these errors were encountered: