[pbs-devel] [PATCH proxmox-backup 2/2] api: format error to show full context for failed chunk uploads
Christian Ebner
c.ebner at proxmox.com
Wed Aug 20 11:58:07 CEST 2025
Currently, only the outer error context is shown, which can hide a
lot of useful information. By reformatting the error, the whole
error context is returned by the api call.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
src/api2/backup/upload_chunk.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/api2/backup/upload_chunk.rs b/src/api2/backup/upload_chunk.rs
index 35378377f..cfbf4aca7 100644
--- a/src/api2/backup/upload_chunk.rs
+++ b/src/api2/backup/upload_chunk.rs
@@ -267,7 +267,7 @@ async fn upload_to_backend(
let is_duplicate = s3_client
.upload_no_replace_with_retry(object_key, data)
.await
- .context("failed to upload chunk to s3 backend")?;
+ .map_err(|err| format_err!("failed to upload chunk to s3 backend - {err:#}"))?;
return Ok((digest, size, encoded_size, is_duplicate));
}
@@ -291,7 +291,7 @@ async fn upload_to_backend(
let is_duplicate = s3_client
.upload_no_replace_with_retry(object_key, data.clone())
.await
- .context("failed to upload chunk to s3 backend")?;
+ .map_err(|err| format_err!("failed to upload chunk to s3 backend - {err:#}"))?;
// Only insert the chunk into the cache after it has been successufuly uploaded.
// Although less performant than doing this in parallel, it is required for consisency
--
2.47.2
More information about the pbs-devel
mailing list