Skip to content

Commit

Permalink
Include HTTP status code in exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
kgodlewski committed Jan 14, 2025
1 parent bdb8c4a commit 8fd053a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/neptune_scale/net/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fd053a

Please sign in to comment.