From d83839ddf3d6d76040e4f3d4308b0510e04b7716 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Mon, 25 Mar 2024 12:53:48 +0100 Subject: [PATCH] pxar: bin: add more context to extraction error Show more of the extraction error context provided by the pxar decoder. Signed-off-by: Christian Ebner --- pxar-bin/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pxar-bin/src/main.rs b/pxar-bin/src/main.rs index 2657577d..b4c8f062 100644 --- a/pxar-bin/src/main.rs +++ b/pxar-bin/src/main.rs @@ -231,7 +231,8 @@ fn extract_archive( if archive == "-" { let stdin = std::io::stdin(); let mut reader = stdin.lock(); - extract_archive_from_reader(&mut reader, target, feature_flags, options, None)?; + extract_archive_from_reader(&mut reader, target, feature_flags, options, None) + .map_err(|err| format_err!("error extracting archive - {err:#}"))?; } else { log::debug!("PXAR extract: {}", archive); let file = std::fs::File::open(archive)?; @@ -248,7 +249,8 @@ fn extract_archive( feature_flags, options, payload_reader.as_mut(), - )?; + ) + .map_err(|err| format_err!("error extracting archive - {err:#}"))? } if !was_ok.load(Ordering::Acquire) {