aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/northstar
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-05-20 00:05:25 +0200
committerGitHub <noreply@github.com>2023-05-20 00:05:25 +0200
commit988d7cecb48201ec7671be79a5f4f6e399efa36c (patch)
treed4c36827c37dcf4ede84d1c53b949e454989a124 /src-tauri/src/northstar
parent76f621a8454389ffbe1a6fe7fada0deeebf2f757 (diff)
downloadFlightCore-988d7cecb48201ec7671be79a5f4f6e399efa36c.tar.gz
FlightCore-988d7cecb48201ec7671be79a5f4f6e399efa36c.zip
fix: Handle case when failing to connect to TS while trying to install NS (#364)
Diffstat (limited to 'src-tauri/src/northstar')
-rw-r--r--src-tauri/src/northstar/install.rs8
1 files changed, 7 insertions, 1 deletions
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<String>,
) -> Result<String, String> {
- 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())