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

Improve login error message #431

Closed
wants to merge 3 commits into from
Closed

Conversation

Or-Geva
Copy link
Contributor

@Or-Geva Or-Geva commented Oct 11, 2023

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • I used npm run format for formatting the code before submitting the pull request.

Fixes: #430

@Or-Geva Or-Geva requested a review from yahavi October 11, 2023 10:51
@Or-Geva Or-Geva added improvement Automatically generated release notes safe to test Approve running integration tests on a pull request labels Oct 11, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 11, 2023
@Or-Geva Or-Geva added the safe to test Approve running integration tests on a pull request label Oct 11, 2023
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Oct 11, 2023
src/main/connect/connectionManager.ts Show resolved Hide resolved
src/test/tests/maven.test.ts Outdated Show resolved Hide resolved
src/main/connect/connectionManager.ts Show resolved Hide resolved
) {
return false;
this.deleteCredentialsFromMemory();
return TestConnectionStatus.FailedBadCredentials;
Copy link
Member

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.

Comment on lines +184 to +186
if (!(await this.testConnectionHealth())) {
this.deleteCredentialsFromMemory();
return TestConnectionStatus.FailedServerNotFound;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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;
Copy link
Member

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

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

Successfully merging this pull request may close these issues.

Improve Login Error message
2 participants