-
Notifications
You must be signed in to change notification settings - Fork 60
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 config errors more easy to debug #39
Comments
Hey, yep noticed this yesterday with my own config when I pushed up the breaking changes. A lot of the problem seems to come from Serde and the way untagged enums work - basically it "guesses" the different config options for multiple monitors/bars and if there's anything invalid inside that block (ie the whole bar config) it nopes out. I also recently updated Corn which adds direct deserialization support, but that doesn't give you line numbers yet which is...inconvenient. I've got to do some planning around what I can do to resolve that as I don't think it's particularly trivial. For now, I'd recommend the following:
|
Looks like there has been a long-standing PR for this in Serde that so far hasn't gained any response from maintainers. It may be possible to patch this in, but I wouldn't be able to publish a patched version to crates.io It may also be possible to write a custom deserializer to try and better capture the errors. |
Actually sorry @JustSimplyKyle it looks like I actually misunderstood the main problem in my first response (hurriedly answered at lunch...). This is a problem with the Corn file not being valid, rather than any config changes in Ironbar. That means if you use I'll leave this open as there clearly does need to be improvements across the board, but the issue you described is out of scope & needs an issue in Corn instead. |
Right, two big improvements on the way:
As for the last example, I've no idea since this is coming from the bar itself rather than loading the config. Hopefully the refactoring I merged in yesterday I got it. Hoping to merge in the above in the next couple of days. |
Currently I'm in the middle of writing a config.
![image](https://user-images.githubusercontent.com/68589851/204546863-374d3994-92b4-465b-b7cb-4bc4fef0402a.png)
![image](https://user-images.githubusercontent.com/68589851/204546942-7d70ae36-e3fc-4990-974d-dc2d174ddee0.png)
I'm... trying to debug? but the error msg isn't exactly useful
I hope that at least we can add an message to tell the user which line of the config has gone wrong
The text was updated successfully, but these errors were encountered: