1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:37:44 +00:00

LibCore+Everywhere: Return ErrorOr from ConfigFile factory methods

I've attempted to handle the errors gracefully where it was clear how to
do so, and simple, but a lot of this was just adding
`release_value_but_fixme_should_propagate_errors()` in places.
This commit is contained in:
Sam Atkins 2022-02-06 13:33:42 +00:00 committed by Tim Flynn
parent 1a4dd47d5f
commit 8260135d4d
31 changed files with 77 additions and 51 deletions

View file

@ -1196,7 +1196,13 @@ void TerminalWidget::set_color_scheme(StringView name)
"White"
};
auto color_config = Core::ConfigFile::open(String::formatted("/res/terminal-colors/{}.ini", name));
auto path = String::formatted("/res/terminal-colors/{}.ini", name);
auto color_config_or_error = Core::ConfigFile::open(path);
if (color_config_or_error.is_error()) {
dbgln("Unable to read color scheme file '{}': {}", path, color_config_or_error.error());
return;
}
auto color_config = color_config_or_error.release_value();
m_show_bold_text_as_bright = color_config->read_bool_entry("Options", "ShowBoldTextAsBright", true);