aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-05-29 18:50:16 +0200
committerGitHub <noreply@github.com>2023-05-29 18:50:16 +0200
commit87e08d4802bcff28f8bdf9a8f23b439d1204e1e4 (patch)
tree997cb12e6f1b8f139316714de756a581e180805a
parent7401e23159bfcc758a86b688a67618a72142280a (diff)
downloadFlightCore-87e08d4802bcff28f8bdf9a8f23b439d1204e1e4.tar.gz
FlightCore-87e08d4802bcff28f8bdf9a8f23b439d1204e1e4.zip
fix: Return error on TS package index fetch fail (#371)
instead of panicking
-rw-r--r--src-tauri/src/mod_management/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index 43464c8f..c6374623 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -342,8 +342,7 @@ async fn get_ns_mod_download_url(thunderstore_mod_string: &str) -> Result<String
async fn get_mod_dependencies(thunderstore_mod_string: &str) -> Result<Vec<String>, anyhow::Error> {
log::info!("Attempting to get dependencies for: {thunderstore_mod_string}");
- // TODO: This will crash the thread if not internet connection exist. `match` should be used instead
- let index = thermite::api::get_package_index().unwrap().to_vec();
+ let index = thermite::api::get_package_index()?.to_vec();
// String replace works but more care should be taken in the future
let ts_mod_string_url = thunderstore_mod_string.replace('-', "/");