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

[BUG] Make Config.yml / type ConfigSettings Construction Error more clear. #14

Open
markpbaggett opened this issue May 20, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@markpbaggett
Copy link
Owner

markpbaggett commented May 20, 2020

Describe the bug
moldybread.nim reports "Must set value of logfile in config.yml. See default_config.yml." when there is a YamlConstructionError. This is misleading because it can be caused by a wide variety of things including:

  1. If you're running an old version of moldybread with a new config.yml, there is a mismatch in keys and values between the compiled type, the yaml/serialization library, and the config.
  2. If you're running a new version of moldybread with an old config.yml, there is a mismatch in keys and values between the compiled type, the yaml/serialization library, and the config.

To Reproduce

  1. Run moldybread head against a config.yml that has an extra key.
  2. Run moldybread head against a config.yml that is missing a key.

Expected behavior
The message should indicate what the problem is: that the yaml being used doesn't isn't aligned with the current version of moldybread.

Screenshots
With no handling, here's what we'd see with a missing field:

Error: unhandled exception: While constructing ConfigSettings: Missing field: "max_results" [YamlConstructionError]

With no handling, here's what we'd see with an extra field:

Error: unhandled exception: While constructing ConfigSettings: Unknown field: "yo" [YamlConstructionError]

With current handling, this is what we see:
Must set value of logfile in config.yml. See default_config.yml.

🤦‍♂️

Additional context
The Yaml Library we are using makes this a little difficult. Minimally, we should just get the exception handler to reflect reality better. If possible, it'd be nice to point out what the problem is.

Also, it should be said that the current handler is recent, so any old versions of moldybread should have an error similar to an unhandled exception.

@markpbaggett markpbaggett added the bug Something isn't working label May 20, 2020
@markpbaggett markpbaggett self-assigned this May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant