From: Robert Obkircher <r.obkircher@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH v1 proxmox-backup 2/2] tree-wide: avoid struct-style debug representation of anyhow errors
Date: Thu, 30 Apr 2026 11:17:44 +0200 [thread overview]
Message-ID: <20260430092022.31857-3-r.obkircher@proxmox.com> (raw)
In-Reply-To: <20260430092022.31857-1-r.obkircher@proxmox.com>
Print all causes in a single, colon-separated line instead of using
the debug struct representation and no longer quote simple errors that
don't have a context.
Note that neither representation includes backtraces. Those are only
displayed with ':?'.
Signed-off-by: Robert Obkircher <r.obkircher@proxmox.com>
---
src/api2/admin/datastore.rs | 8 ++++----
src/server/pull.rs | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index a814c076c..1e0a78f3a 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -470,7 +470,7 @@ pub async fn delete_snapshot(
let snapshot = datastore.backup_dir(ns, backup_dir)?;
datastore
.delete_snapshot(&snapshot)
- .map_err(|err| format_err!("failed to delete snapshot - {err:#?}"))?;
+ .map_err(|err| format_err!("failed to delete snapshot - {err:#}"))?;
Ok(Value::Null)
})
.await?
@@ -1096,7 +1096,7 @@ pub fn prune(
if !keep {
if let Err(err) = datastore.delete_snapshot(backup_dir) {
warn!(
- "failed to remove dir {:?}: {err:#?}",
+ "failed to remove dir {:?}: {err:#}",
backup_dir.relative_path()
);
}
@@ -1653,7 +1653,7 @@ pub fn upload_backup_log(
datastore.add_blob(file_name.as_ref(), backup_dir, blob, &backend)
})
.await
- .map_err(|err| format_err!("{err:#?}"))??;
+ .map_err(|err| format_err!("{err:#}"))??;
// fixme: use correct formatter
Ok(formatter::JSON_FORMATTER.format_data(Value::Null, &*rpcenv))
@@ -2118,7 +2118,7 @@ pub fn set_group_notes(
let backup_group = datastore.backup_group(ns, backup_group);
datastore
.set_group_notes(notes, backup_group)
- .map_err(|err| format_err!("failed to set group notes - {err:#?}"))?;
+ .map_err(|err| format_err!("failed to set group notes - {err:#}"))?;
Ok(())
}
diff --git a/src/server/pull.rs b/src/server/pull.rs
index 055a710fc..11a9a8ff9 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -1322,7 +1322,7 @@ async fn pull_group(
log_sender
.log(
Level::WARN,
- format!("Failed to collect reusable chunk from last backup: {err:#?}"),
+ format!("Failed to collect reusable chunk from last backup: {err:#}"),
)
.await?;
}
--
2.47.3
prev parent reply other threads:[~2026-04-30 9:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 9:17 [PATCH v1 proxmox-backup 0/2] improve logging Robert Obkircher
2026-04-30 9:17 ` [PATCH v1 proxmox-backup 1/2] datastore: improve error if prune can't lock a snapshot for deletion Robert Obkircher
2026-04-30 9:17 ` Robert Obkircher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260430092022.31857-3-r.obkircher@proxmox.com \
--to=r.obkircher@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.