[pdm-devel] applied: [PATCH datacenter-manager] server: connection: improve error messages for remotes

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Apr 14 16:53:13 CEST 2025


applied, thanks

On Fri, Apr 11, 2025 at 04:05:57PM +0200, Dominik Csapak wrote:
> by including either the original error, or a notice that it timed out.
> That way, when we return the error over the API, the user can maybe
> better see what the actual problem is.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  server/src/connection.rs | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/server/src/connection.rs b/server/src/connection.rs
> index 1688fb3..201d65b 100644
> --- a/server/src/connection.rs
> +++ b/server/src/connection.rs
> @@ -747,13 +747,17 @@ macro_rules! try_request {
>  
>              if let Some(err) = last_err {
>                  log::error!("API client error (giving up) - {err:?}");
> +                Err(proxmox_client::Error::Client(err))
>              } else if timed_out {
>                  log::error!("API client timed out, no remotes reachable, giving up");
> +                Err(proxmox_client::Error::Other(
> +                    "failed to perform API request: timed out",
> +                ))
> +            } else {
> +                Err(proxmox_client::Error::Other(
> +                    "failed to perform API request: unknown error",
> +                ))
>              }
> -
> -            Err(proxmox_client::Error::Other(
> -                "failed to perform API request",
> -            ))
>          })
>      };
>  }
> -- 
> 2.39.5




More information about the pdm-devel mailing list