[pbs-devel] [PATCH v4 proxmox-backup 32/58] file restore: show more error context when extraction fails

Christian Ebner c.ebner at proxmox.com
Mon Apr 29 14:10:36 CEST 2024


Otherwise the context swallows the actual, underlying error message.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 proxmox-file-restore/src/main.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/proxmox-file-restore/src/main.rs b/proxmox-file-restore/src/main.rs
index 36a988708..36dd14ff4 100644
--- a/proxmox-file-restore/src/main.rs
+++ b/proxmox-file-restore/src/main.rs
@@ -496,7 +496,9 @@ async fn extract(
                 Accessor::new(reader, archive_size, None).await?
             };
 
-            extract_to_target(decoder, &path, target, format, zstd).await?;
+            extract_to_target(decoder, &path, target, format, zstd)
+                .await
+                .map_err(|err| format_err!("error extracting archive - {err:#}"))?;
         }
         ExtractPath::VM(file, path) => {
             let details = SnapRestoreDetails {
-- 
2.39.2





More information about the pbs-devel mailing list