-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Unify unauthenticated errors for Cloud commands #5117
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
Conversation
984c814
to
d6a8512
Compare
d6a8512
to
bc3f664
Compare
internal/cmd/cloud.go
Outdated
"github.com/spf13/pflag" | ||
) | ||
|
||
// ErrUserUnauthenticated represents an authentication error when trying to use |
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.
Do we really need to make this error public? 🤔 I'm wondering because I see it's used by no other package, and it's internal
so other projects like extensions could not use it.
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.
No, we don't. I've changed it, good catch!
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.
Despite the few minor comments I left, it looks pretty well! 👍🏻
Co-authored-by: Joan López de la Franca Beltran <[email protected]>
What?
If the user is not logged in or didn't provide any TOKEN option via the available methods then it will fail with a nicer error hinting how to fix it.
If the token is provided but it is not valid then the error it is still delegated to the Cloud.
Why?
If the user forgot to log in or didn't know about the requirement now it is easier to understand and fix it.
Checklist
make check
) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)
Closes #5077