[pbs-devel] [PATCH v7 proxmox-backup 33/69] file restore: show more error context when extraction fails

Christian Ebner c.ebner at proxmox.com
Mon May 27 16:32:47 CEST 2024


Otherwise the context swallows the actual, underlying error message.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 6:
- no changes

 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 0de2b47e6..26e7663a1 100644
--- a/proxmox-file-restore/src/main.rs
+++ b/proxmox-file-restore/src/main.rs
@@ -489,7 +489,9 @@ async fn extract(
             };
             let decoder = Accessor::new(reader, archive_size).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