From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [PATCH proxmox v3 1/4] CLI: print fatal errors including causes
Date: Tue, 18 Jun 2024 15:42:13 +0200 [thread overview]
Message-ID: <62ac742uhz62t72yslijwcldc7iyq222tujaj5ro3w4uxrjvym@yoklmz6l6ymy> (raw)
In-Reply-To: <20240617081259.73805-2-g.goller@proxmox.com>
On Mon, Jun 17, 2024 at 10:12:51AM GMT, Gabriel Goller wrote:
> From: Fabian Grünbichler <f.gruenbichler@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.
>
> More info in `proxmox-router/README.rst`.
This file will not be seen by anyone. It's also not where I'd expect
generic coding style advice and doesn't *really* have much to do with
the router crate.
This info might be better in the developer docs / wiki.
So please drop the file for now.
(Also: such files are better as a separate patch, so it can easily be
dropped while applying.)
> diff --git a/proxmox-router/src/cli/command.rs b/proxmox-router/src/cli/command.rs
> index 7a26ffb9..d5522f12 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);
Could go straight to
eprintln!("Error: {err:?}");
in both cases.
> 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 13:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 8:12 [pbs-devel] [PATCH proxmox{, -backup} v3 0/4] output full anyhow context in client Gabriel Goller
2024-06-17 8:12 ` [pbs-devel] [PATCH proxmox v3 1/4] CLI: print fatal errors including causes Gabriel Goller
2024-06-18 13:42 ` Wolfgang Bumiller [this message]
2024-06-18 14:21 ` Gabriel Goller
2024-06-17 8:12 ` [pbs-devel] [PATCH proxmox-backup v3 2/4] pxar: remove ArchiveError Gabriel Goller
2024-06-17 8:12 ` [pbs-devel] [PATCH proxmox-backup v3 3/4] pxar: add UniqueContext helper Gabriel Goller
2024-06-17 8:12 ` [pbs-devel] [PATCH proxmox-backup v3 4/4] pxar: use anyhow::Error in PxarBackupStream Gabriel Goller
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=62ac742uhz62t72yslijwcldc7iyq222tujaj5ro3w4uxrjvym@yoklmz6l6ymy \
--to=w.bumiller@proxmox.com \
--cc=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