From 806a55eda1d2e76c52fcea2ef11b81f2967b6e74 Mon Sep 17 00:00:00 2001 From: Cygnix Proto <99915288+CygnixProto@users.noreply.github.com> Date: Tue, 6 Dec 2022 16:26:13 +0000 Subject: LibGfx+Userland: Make Gfx::SystemTheme propagate errors This patch introduces error propagation to Gfx::SystemTheme to remove instances of release_value_but_fixme_should_propagate_errors(). Userland applications that have been affected by this change have been updated to utilise this propagation and as a result 4 such instances of the aforementioned method have been removed. --- Userland/Utilities/headless-browser.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Userland/Utilities/headless-browser.cpp') diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index c1aaa5c869..2e8d2df8a3 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -771,10 +771,13 @@ ErrorOr serenity_main(Main::Arguments arguments) auto page_client = HeadlessBrowserPageClient::create(); - if (!resources_folder.is_empty()) - page_client->setup_palette(Gfx::load_system_theme(LexicalPath::join(resources_folder, "themes/Default.ini"sv).string())); - else - page_client->setup_palette(Gfx::load_system_theme("/res/themes/Default.ini")); + if (!resources_folder.is_empty()) { + auto system_theme = TRY(Gfx::load_system_theme(LexicalPath::join(resources_folder, "themes/Default.ini"sv).string())); + page_client->setup_palette(system_theme); + } else { + auto system_theme = TRY(Gfx::load_system_theme("/res/themes/Default.ini")); + page_client->setup_palette(system_theme); + } dbgln("Loading {}", url); page_client->load(AK::URL(url)); -- cgit v1.2.3