public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager] server: connection: improve error messages for remotes
@ 2025-04-11 14:05 Dominik Csapak
  2025-04-14 14:53 ` [pdm-devel] applied: " Wolfgang Bumiller
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-04-11 14:05 UTC (permalink / raw)
  To: pdm-devel

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



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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pdm-devel] applied: [PATCH datacenter-manager] server: connection: improve error messages for remotes
  2025-04-11 14:05 [pdm-devel] [PATCH datacenter-manager] server: connection: improve error messages for remotes Dominik Csapak
@ 2025-04-14 14:53 ` Wolfgang Bumiller
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2025-04-14 14:53 UTC (permalink / raw)
  To: Dominik Csapak; +Cc: pdm-devel

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


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-14 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-11 14:05 [pdm-devel] [PATCH datacenter-manager] server: connection: improve error messages for remotes Dominik Csapak
2025-04-14 14:53 ` [pdm-devel] applied: " Wolfgang Bumiller

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