-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make get_client_config()
raise errors that are more meaningful to the user
#115
Conversation
if "X-Neptune-Api-Token" in error.message: | ||
raise NeptuneInvalidCredentialsError() | ||
|
||
raise_for_http_status(response.status_code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to parse this suggestion, there seems to be a problem with indentation, and it looks like it's not replacing all the lines it should replace. Can you double check?
src/neptune_scale/net/api_client.py
Outdated
token_urls = TokenRefreshingURLs.from_dict(response.json()) | ||
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a response status in the exception message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a response status in the exception message
f08d4a0
to
8fd053a
Compare
A common case is where the user passes an invalid token, and is presented with a cryptic "unable to get client config".