-
Notifications
You must be signed in to change notification settings - Fork 36
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
Improve login error message #431
Conversation
) { | ||
return false; | ||
this.deleteCredentialsFromMemory(); | ||
return TestConnectionStatus.FailedBadCredentials; |
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.
How can you determine that this is a Bad Credential (401) error rather than:
- A permissions problem (403)
- An inactive server - I'm not sure if it is relevant anymore but worth checking
- Any other error, like 5xx
Take a look at testComponentPermission. I recommend returning the precise status from this function.
if (!(await this.testConnectionHealth())) { | ||
this.deleteCredentialsFromMemory(); | ||
return TestConnectionStatus.FailedServerNotFound; |
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.
if (!(await this.testConnectionHealth())) { | |
this.deleteCredentialsFromMemory(); | |
return TestConnectionStatus.FailedServerNotFound; |
And what if we get 401 in the ping? This request seems redundant, because testComponentPermission already handle the response parsing.
return LoginProgressStatus.FailedSaveCredentials; | ||
case TestConnectionStatus.FailedServerNotFound: | ||
return LoginProgressStatus.FailedServerNotFound; |
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.
Let's add another status for permission denied
npm run format
for formatting the code before submitting the pull request.Fixes: #430