From 988d7cecb48201ec7671be79a5f4f6e399efa36c Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Sat, 20 May 2023 00:05:25 +0200 Subject: fix: Handle case when failing to connect to TS while trying to install NS (#364) --- src-tauri/src/northstar/install.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/northstar/install.rs b/src-tauri/src/northstar/install.rs index 344c0ccf..04c58630 100644 --- a/src-tauri/src/northstar/install.rs +++ b/src-tauri/src/northstar/install.rs @@ -113,7 +113,13 @@ pub async fn install_northstar( northstar_package_name: String, version_number: Option, ) -> Result { - let index = thermite::api::get_package_index().unwrap().to_vec(); + let index = match thermite::api::get_package_index() { + Ok(res) => res.to_vec(), + Err(err) => { + log::warn!("Failed fetching package index due to: {err}"); + return Err("Failed to connect to Thunderstore.".to_string()); + } + }; let nmod = index .iter() .find(|f| f.name.to_lowercase() == northstar_package_name.to_lowercase()) -- cgit v1.2.3