emit error on extraction error

This commit is contained in:
SpikeHD
2022-05-16 17:34:41 -07:00
parent 5c0a46b2d2
commit f530ffdd2c

View File

@@ -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();
}
};