From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox v4 1/4] CLI: print fatal errors including causes
Date: Tue, 18 Jun 2024 16:22:00 +0200 [thread overview]
Message-ID: <20240618142207.331674-2-g.goller@proxmox.com> (raw)
In-Reply-To: <20240618142207.331674-1-g.goller@proxmox.com>
as a first step of improving our error handling story, printing context
and causes if the error contains them.
The downside to adding context is that the default Display implementation
will *just* print the context, which hides the root cause. This is why
we print the errors using the pretty-print formatter in this change.
Originally-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
proxmox-router/src/cli/command.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxmox-router/src/cli/command.rs b/proxmox-router/src/cli/command.rs
index 7a26ffb9..a97c9d48 100644
--- a/proxmox-router/src/cli/command.rs
+++ b/proxmox-router/src/cli/command.rs
@@ -83,7 +83,7 @@ async fn handle_simple_command_future(
}
}
Err(err) => {
- eprintln!("Error: {}", err);
+ eprintln!("Error: {err:?}");
return Err(err);
}
}
@@ -135,7 +135,7 @@ fn handle_simple_command(
}
}
Err(err) => {
- eprintln!("Error: {}", err);
+ eprintln!("Error: {err:?}");
return Err(err);
}
}
--
2.43.0
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-06-18 14:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 14:21 [pbs-devel] [PATCH proxmox{, -backup} v4 0/4] output full anyhow context in client Gabriel Goller
2024-06-18 14:22 ` Gabriel Goller [this message]
2024-06-18 14:22 ` [pbs-devel] [PATCH proxmox-backup v4 2/4] pxar: remove ArchiveError Gabriel Goller
2024-06-18 14:22 ` [pbs-devel] [PATCH proxmox-backup v4 3/4] pxar: add UniqueContext helper Gabriel Goller
2024-06-18 14:22 ` [pbs-devel] [PATCH proxmox-backup v4 4/4] pxar: use anyhow::Error in PxarBackupStream Gabriel Goller
2024-06-19 9:36 ` [pbs-devel] applied-series: [PATCH proxmox{, -backup} v4 0/4] output full anyhow context in client Wolfgang Bumiller
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=20240618142207.331674-2-g.goller@proxmox.com \
--to=g.goller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox