From 033a33404700fe250b43a0a423e1484a5377687d Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Tue, 19 Mar 2024 08:07:29 -0700 Subject: [PATCH] fail when zipfile cannot load --- src/utils.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 4c1bb912..d28f7395 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -538,7 +538,10 @@ impl std::fmt::Display for ReportType { pub fn collection_from_zipfile(sigpath: &Path, report_type: &ReportType) -> Result { match Collection::from_zipfile(sigpath) { Ok(collection) => Ok(collection), - Err(_) => bail!("failed to load {} zipfile: '{}'", report_type, sigpath), + Err(e) => { + eprintln!("Error: {}", e); + bail!("failed to load {} zipfile: '{}'", report_type, sigpath); + } } } @@ -679,8 +682,8 @@ pub fn load_collection( match collection_from_zipfile(&sigpath, &report_type) { Ok(coll) => Some((coll, 0)), Err(e) => { - last_error = Some(e); - None + eprintln!("Error: {}", e); + bail!("Cannot load '{}' as zipfile.", &siglist); } } } else {