[pbs-devel] [PATCH v9 proxmox-backup 19/58] pxar: bin: add more context to extraction error

Christian Ebner c.ebner at proxmox.com
Wed Jun 5 12:53:37 CEST 2024


Show more of the extraction error context provided by the pxar decoder.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 8:
- prefix patch subject with `pxar: bin` instead of `pxar` only

 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 2657577dc..b4c8f0626 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) {
-- 
2.39.2





More information about the pbs-devel mailing list