From 8fd053a0a6f57e2bba7374ca0416a5e3be7edb01 Mon Sep 17 00:00:00 2001 From: Krzysztof Godlewski Date: Tue, 14 Jan 2025 12:55:10 +0100 Subject: [PATCH] Include HTTP status code in exception message --- src/neptune_scale/net/api_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/neptune_scale/net/api_client.py b/src/neptune_scale/net/api_client.py index 7a3b918..bd0bcc8 100644 --- a/src/neptune_scale/net/api_client.py +++ b/src/neptune_scale/net/api_client.py @@ -110,7 +110,10 @@ def get_config_and_token_urls( ) as client: response = get_client_config.sync_detailed(client=client) if response.parsed is None: - raise NeptuneScaleError(message="Failed to initialize API client: invalid response from server") + raise NeptuneScaleError( + message="Failed to initialize API client: invalid response from server. " + f"Status code={response.status_code}" + ) if response.status_code != 200 or not isinstance(response.parsed, ClientConfig): error = response.parsed if isinstance(response.parsed, Error) else None