public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@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 16:21:16 +0200	[thread overview]
Message-ID: <20240618142116.t7y65zmqozxlmuff@luna.proxmox.com> (raw)
In-Reply-To: <62ac742uhz62t72yslijwcldc7iyq222tujaj5ro3w4uxrjvym@yoklmz6l6ymy>

On 18.06.2024 15:42, Wolfgang Bumiller wrote:
>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.

I agree and I'm going to remove this from the next version.

When this is merged where do you think we should put this? I don't think
a new header in
https://pbs.proxmox.com/wiki/index.php/Developer_Documentation is really
fitting. Maybe a new site `Development Best Practices` with 'use context
instead of format_err'? :)

>> 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.

Submitted a v4 already!


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

  reply	other threads:[~2024-06-18 14:21 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
2024-06-18 14:21     ` Gabriel Goller [this message]
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=20240618142116.t7y65zmqozxlmuff@luna.proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=w.bumiller@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal