From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>
Cc: pdm-devel@lists.proxmox.com
Subject: Re: [pdm-devel] [RFC PATCH datacenter-manager] server: api: resources: use root cause for errors for remote fetching
Date: Wed, 10 Sep 2025 12:19:51 +0200 [thread overview]
Message-ID: <77fqpefbjxlf6lqfx4fbutbinlwpcgttplu7tvch6rw3opdes7@2itxjkmiklzk> (raw)
In-Reply-To: <a11bed88-dd3f-4195-a789-de07f630c5fd@proxmox.com>
On Wed, Sep 10, 2025 at 10:31:52AM +0200, Dominik Csapak wrote:
>
>
> On 9/10/25 10:15 AM, Wolfgang Bumiller wrote:
> > On Tue, Sep 09, 2025 at 10:25:51AM +0200, Dominik Csapak wrote:
> > > when we can't reach a remote for any reason, we want to return the error
> > > as a string here over the API. Since most errors that can occur here are
> > > client/network related (wrong credentials, no route to host, timeout,
> > > etc.) converting this error directly to a string gives us
> > > errors like:
> > >
> > > `client error (Connect)`
> > >
> > > which is not really helpful most of the time.
> > > Instead if we use the `root_cause()`, we get the most underlying error
> > >
> > > e.g.
> > >
> > > `error connecting to https://0.0.0.0:8006/ - tcp connect error: No route to host (os error 113)`
> > >
> > > which is much more helpful.
> > >
> > > We could also think about printing the whole error chain, but in my test
> > > cases here this was not more helpful, e.g. i got two times the above
> > > `client error (Connect)` and once the root cause from above.
> >
> > Curious, because from a quick grep, `client error (*)` comes from hyper.
> > Otherwise I'd say it may have been one our own error types or
> > one-too-many same `.context()` calls.
> >
> > I'm still not sure this is a good idea though, as we may still lose some
> > useful contest. I wish anyhow had an easy method to just shave off a
> > single layer.
> >
> > What if we do this, but first throw in a:
> >
> > tracing::debug!("{error:?}");
> >
> > just so we still have the option to see everything if we need to?
>
> just to clarify: you want me to use root_cause and additionally log the
> error into the debug tracing? (not returning the whole `chain()` here)
Yes. Log the complete error at debug-level but only return the root
cause.
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-09-10 10:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 8:25 Dominik Csapak
2025-09-10 8:15 ` Wolfgang Bumiller
2025-09-10 8:31 ` Dominik Csapak
2025-09-10 10:19 ` Wolfgang Bumiller [this message]
2025-09-10 15:12 ` [pdm-devel] applied: " Thomas Lamprecht
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=77fqpefbjxlf6lqfx4fbutbinlwpcgttplu7tvch6rw3opdes7@2itxjkmiklzk \
--to=w.bumiller@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pdm-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