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: show more meaningful error message for failed auth #879

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

AndreDalcher
Copy link
Contributor

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

Previously when snyk auth failed for any reason we would always show the AuthFailed error without checking what the status code was. This PR attempts to make the error message more useful to the user by distinguishing failed authorisation checks from other types of errors (network timeouts etc.)

How should this be manually tested?

Run against a local registry, override the endpoint called by verifyAPI to return a 502 response (or any other).

Any background context you want to provide?

There is already handling in place for 502 errors, but coercing all error types into a Not Authorised error resulted in it never being reached

What are the relevant tickets?

Zendesk

@AndreDalcher AndreDalcher requested a review from a team as a code owner November 25, 2019 12:29
@ghost ghost requested review from lwywoo and miiila November 25, 2019 12:29
@AndreDalcher AndreDalcher merged commit 2d19f4d into master Nov 25, 2019
@AndreDalcher AndreDalcher deleted the fix/failed-auth-messaging branch November 25, 2019 14:41
@snyksec
Copy link

snyksec commented Nov 25, 2019

🎉 This PR is included in version 1.251.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants