mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 08:15:21 +01:00
[GH-ISSUE #39] Make config errors more easy to debug #8458
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#8458
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JustSimplyKyle on GitHub (Nov 29, 2022).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/39
Currently I'm in the middle of writing a config.


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
@JustSimplyKyle commented on GitHub (Nov 29, 2022):
Another example:

@JakeStanger commented on GitHub (Nov 29, 2022):
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:
corn-clicrate to easily convert Corn to any of those.@JakeStanger commented on GitHub (Nov 29, 2022):
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
https://github.com/serde-rs/serde/pull/1544
It may also be possible to write a custom deserializer to try and better capture the errors.
@JakeStanger commented on GitHub (Nov 29, 2022):
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
corn-clias above you should get much more detailed error output.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.
@JakeStanger commented on GitHub (Dec 12, 2022):
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.