diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-03-20 12:37:22 +0100 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-03-20 12:37:22 +0100 |
commit | 705021e90c8a854fe4ea5416cb5e49564b1e9d20 (patch) | |
tree | 49fbd6d1d3134a5514bc1cf57c3e29228729d697 | |
parent | c102fdcf8ef00e3c5c46fb9ded37e09b7e92e483 (diff) | |
download | FlightCore-705021e90c8a854fe4ea5416cb5e49564b1e9d20.tar.gz FlightCore-705021e90c8a854fe4ea5416cb5e49564b1e9d20.zip |
fix: Handle error when Northstar download fails
In case of download failure return an error message
-rw-r--r-- | src-tauri/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index ee3c91ed..1e548166 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -195,7 +195,10 @@ async fn do_install(nmod: &thermite::model::ModVersion, game_path: &std::path::P let download_path = format!("{}/{}", download_directory.clone(), filename); println!("{}", download_path); - let nfile = thermite::core::manage::download_file(&nmod.url, download_path).unwrap(); + let nfile = match thermite::core::manage::download_file(&nmod.url, download_path){ + Ok(res) => res, + Err(err) => return Err(anyhow!("Failed downloading Northstar {}", err)), + }; println!("Extracting Northstar..."); extract(nfile, game_path)?; |