Skip to content

Commit 83432ac

Browse files
committed
updated error handling
1 parent 2e09e49 commit 83432ac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src-tauri/src/lib/idf_versions.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ pub struct Releases {
3838

3939
// TODO: handle the possibility of multiple downloads
4040
pub async fn get_idf_versions() -> Result<Releases, String> {
41-
Ok(download_idf_versions().await.unwrap())
41+
match download_idf_versions().await {
42+
Ok(versions) => Ok(versions),
43+
Err(e) => {
44+
let err_msg = format!("Failed to download IDF versions.json file: {}", e);
45+
error!("{}", err_msg);
46+
Err(err_msg)
47+
}
48+
}
4249
}
4350

4451
/// Retrieves the available IDF targets from the official website.

0 commit comments

Comments
 (0)