From f530ffdd2c655c854ce638cf663d9f133dcc7da1 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Mon, 16 May 2022 17:34:41 -0700 Subject: [PATCH] emit error on extraction error --- src-tauri/src/unzip.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src-tauri/src/unzip.rs b/src-tauri/src/unzip.rs index e76c5b1..19333dd 100644 --- a/src-tauri/src/unzip.rs +++ b/src-tauri/src/unzip.rs @@ -28,6 +28,19 @@ pub fn unzip(window: tauri::Window, zipfile: String, destpath: String) { }, Err(e) => { println!("Failed to extract zip file: {}", e); + let mut res_hash = std::collections::HashMap::new(); + + res_hash.insert( + "error".to_string(), + e.to_string() + ); + + res_hash.insert( + "path".to_string(), + zipfile.to_string() + ); + + window.emit("download_error", &res_hash).unwrap(); } };