From 57a722a3fb7cfac6827fcb075ce72c8bc0dfa89a Mon Sep 17 00:00:00 2001 From: KuleRucket <737724+KuleRucket@users.noreply.github.com> Date: Tue, 28 Mar 2023 23:54:46 +0200 Subject: [PATCH] Continue in the face of failure (#1094) Co-authored-by: KuleRucket --- src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 991631fa..da5139e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -346,18 +346,20 @@ main(int argc, char *argv[]) { proc::refresh(config::stream.file_apps); - auto deinit_guard = platf::init(); - if (!deinit_guard) { - return 4; + // If any of the following fail, we log an error and continue event though sunshine will not function correctly. + // This allows access to the UI to fix configuration problems or view the logs. + if (!platf::init()) { + BOOST_LOG(error) << "Platform failed to initialize"sv; } reed_solomon_init(); auto input_deinit_guard = input::init(); if (video::init()) { - return 2; + BOOST_LOG(error) << "Video failed to initialize"sv; } + if (http::init()) { - return 3; + BOOST_LOG(error) << "http failed to initialize"sv; } std::unique_ptr mDNS;