[pbs-devel] [PATCH v8 proxmox-backup 36/69] pxar: add more context to extraction error

Christian Ebner c.ebner at proxmox.com
Tue May 28 11:42:30 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 7:
- no changes

changes since version 6:
- no changes

 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 b64ae1d19..17e468062 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