-
Notifications
You must be signed in to change notification settings - Fork 841
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
Improve config file parsing error messages #269
Comments
I agree. This is also related to #48. |
No objection from me. |
I commented about some stuff with config file parsing in #211, but this ticket is more clearly more appropriate for my suggestion, so I'll just restate it here: There's now a wiki page (still in progress) documenting everything about I recommend that all config-file parsing errors show a link to this page, and if possible, a specific subsection about whatever directive couldn't be parsed. |
The way I have tackled this in the past is to just override the |
This overrides the aeson combinators to have better error messages Just import Data.Aeson.Extended instead of Data.Aeson
Addressed by #284. Here is the output I get from that.
Including both the path to the config file and a link to the wiki documentation of the YAML config should be done, but perhaps a separate issue can be opened for that? |
This overrides the aeson combinators to have better error messages Just import Data.Aeson.Extended instead of Data.Aeson
Probably can leave this issue open to address the rest (I've added steps to the top comment), but I have no objection to merging the pull request. Thanks! |
For example, if I put
install-ghc: 123
in a stack.yaml, I get this not very informative error:We should at least catch AesonExceptions when parsing the config files and wrap them in our own "ConfigParseFailedException" (or something like that), and include the path to the config file where the failure occurred in the message. If there was a way to get Aeson to report the field with the error that would be even better (I don't know if that's possible though).
The text was updated successfully, but these errors were encountered: