From c318df7970a9aa0bf885427c4d30194a9a1e7bb3 Mon Sep 17 00:00:00 2001 From: ibazian Date: Wed, 9 Oct 2024 18:03:38 +0200 Subject: [PATCH] reformating for passing tests --- src/ansys/simai/core/utils/requests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ansys/simai/core/utils/requests.py b/src/ansys/simai/core/utils/requests.py index 4610e9de..9badc03b 100644 --- a/src/ansys/simai/core/utils/requests.py +++ b/src/ansys/simai/core/utils/requests.py @@ -69,8 +69,11 @@ def handle_http_errors(response: requests.Response) -> None: if response.status_code == 404: raise NotFoundError(f"{message}", response) from e else: + error_message = f"{response.status_code} {message}" + if resolution := json_response.get("resolution", ""): + error_message += f"\n{resolution}" raise ApiClientError( - f"{response.status_code} {message}.\n{json_response.get('resolution', '')}", + error_message, response, ) from e else: