-
Notifications
You must be signed in to change notification settings - Fork 106
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
Ignore invalid display config files and boot normally. #3635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the new behaviour optional (off by default)?
Keep the current constructor so we don't break ABI, but add a new one with a bool exit_on_error=true
?
This way, Frame we can make to start up regardless of display config issues.
Also, in StaticDisplayConfig
we could then log an error for the less critical bits and ignore / use defaults for that particular element rather than bail completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that I'm against the resolution suggested in the issue. (This implements that resolution: I'm not against the implementation)
As discussed on the bug, maybe having a special case (and that could be default) for the file being empty would also do. |
+1
Or use the "named constructor" idiom:
I'm still not convinced this is desirable |
Also, we should have tests |
Lucky for me, we already do (the ones failing right now :)). I'll see if I can add any. |
902efbe
to
c924412
Compare
We decided on another approach |
Closes #3628
Adds a new exception type
StaticDsiplayConfig::InvalidConfig
, which is now used insideYamlFileDisplayConfig::load_config
to signal a failure in parsing. When this exception is caught, we skip the rest of config parsing and the remaining code that depends on it and run as if--display-config=static=path/to/invalid/file.display
was not provided.