From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1B68D1FF37F for ; Tue, 18 Jun 2024 15:42:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CDF281BC4B; Tue, 18 Jun 2024 15:42:15 +0200 (CEST) Date: Tue, 18 Jun 2024 15:42:13 +0200 From: Wolfgang Bumiller To: Gabriel Goller Message-ID: <62ac742uhz62t72yslijwcldc7iyq222tujaj5ro3w4uxrjvym@yoklmz6l6ymy> References: <20240617081259.73805-1-g.goller@proxmox.com> <20240617081259.73805-2-g.goller@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240617081259.73805-2-g.goller@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.093 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [command.rs] Subject: Re: [pbs-devel] [PATCH proxmox v3 1/4] CLI: print fatal errors including causes X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Cc: pbs-devel@lists.proxmox.com Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On Mon, Jun 17, 2024 at 10:12:51AM GMT, Gabriel Goller wrote: > From: Fabian Gr=FCnbichler > = > 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/c= ommand.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) =3D> { > - 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) =3D> { > - 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