Skip to content
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

fix: handle malformed API key errors #275

Merged
merged 3 commits into from
Feb 19, 2021
Merged

fix: handle malformed API key errors #275

merged 3 commits into from
Feb 19, 2021

Conversation

EverlastingBugstopper
Copy link
Contributor

fixes #215

before:

$ rover config whoami --profile malformed-key
error: 406: Not Acceptable

after:

$ rover config whoami --profile malformed-key
error: The API key you provided is malformed. An API key must have three parts separated by a colon.
        Visit https://go.apollo.dev/r/api-keys for more details on Apollo's API keys.

@@ -55,6 +55,10 @@ impl Client {
serde_json::from_str(&response_text)?;

if let Some(errs) = response_body.errors {
if !errs.is_empty() && errs[0].message.contains("406") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭 😭 😭

(this sounds good though)

Copy link
Member

@lrlna lrlna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@lrlna lrlna merged commit 8f95a69 into main Feb 19, 2021
@lrlna lrlna deleted the avery/406 branch February 19, 2021 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add error handling for 406 error
2 participants