[pbs-devel] [PATCH v3 proxmox-backup 3/6] garbage collection: format error including anyhow error context

Christian Ebner c.ebner at proxmox.com
Thu Mar 20 13:30:07 CET 2025


Until now errors are shown ignoring the anyhow error context. In
order to allow the garbage collection to return additional error
context, format the error including the context as single line.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 1:
- not present in previous version

 src/api2/admin/datastore.rs     | 4 +---
 src/bin/proxmox-backup-proxy.rs | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index cfe319c4e..54dad81cb 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1219,9 +1219,7 @@ pub fn start_garbage_collection(
         crate::server::do_garbage_collection_job(job, datastore, &auth_id, None, to_stdout)
             .map_err(|err| {
                 format_err!(
-                    "unable to start garbage collection job on datastore {} - {}",
-                    store,
-                    err
+                    "unable to start garbage collection job on datastore {store} - {err:#}"
                 )
             })?;
 
diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index fdfa7463a..dd735767f 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -543,7 +543,7 @@ async fn schedule_datastore_garbage_collection() {
             Some(event_str),
             false,
         ) {
-            eprintln!("unable to start garbage collection job on datastore {store} - {err}");
+            eprintln!("unable to start garbage collection job on datastore {store} - {err:#}");
         }
     }
 }
-- 
2.39.5





More information about the pbs-devel mailing list