From c4b20d7aaec5aeb2cdbe5078ad81ef050f0a1423 Mon Sep 17 00:00:00 2001 From: benjaminastrand Date: Mon, 2 Dec 2024 10:54:16 +0100 Subject: [PATCH] Error info when failing to add client --- fedn/network/clients/fedn_client.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fedn/network/clients/fedn_client.py b/fedn/network/clients/fedn_client.py index 3f7124cb..dced3d2b 100644 --- a/fedn/network/clients/fedn_client.py +++ b/fedn/network/clients/fedn_client.py @@ -106,11 +106,9 @@ def connect_to_api(self, url: str, token: str, json: dict) -> Tuple[ConnectToApi elif response.status_code == 404: logger.warning("Connect to FEDn Api - Incorrect URL") return ConnectToApiResult.IncorrectUrl, "Incorrect URL" - except Exception: - pass - - logger.warning("Connect to FEDn Api - Unknown error occurred") - return ConnectToApiResult.UnknownError, "Unknown error occurred" + except Exception as e: + logger.warning(f"Connect to FEDn Api - Error occurred: {str(e)}") + return ConnectToApiResult.UnknownError, str(e) def download_compute_package(self, url: str, token: str, name: str = None) -> bool: """Download compute package from controller