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

Include connectivity to server check in invalid server or credentials error #2545

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

dotNomad
Copy link
Collaborator

@dotNomad dotNomad commented Jan 22, 2025

This PR changes the errInvalidServerOrCredentials to be more broad to include the case where the Connect server is down or cannot be connected to. Now rather than only suggesting to check the provided server URL and API key it now also suggested checking "connectivity to the server".

Intent

Resolves #2450

Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

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

A few quick improvements requested.

@@ -86,7 +86,7 @@ func (u *UserDTO) CanPublish() bool {
return u.UserRole == AuthRoleAdmin || u.UserRole == AuthRolePublisher
}

var errInvalidServerOrCredentials = errors.New("could not validate credentials; check server URL and API key or token")
var errInvalidServerOrCredentials = errors.New("could not validate credentials; check connectivity to the server, the URL, and API key")
var errInvalidApiKey = errors.New("could not log in with the provided credentials")
var errInvalidServer = errors.New("could not access the server; check the server URL and try again")
Copy link
Collaborator

Choose a reason for hiding this comment

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

With a Server URL connectivity issue when creating credentials, I encountered this error. Did we not want to also update this message to check connectivity?

2025-01-22 at 8 31 AM

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also update the second and third errors to show the server URL with which we're trying to connect?

2025-01-22 at 8 33 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Did we not want to also update this message to check connectivity?

For this error it does include "could not access the server" which to me covers the case where the server is down. Were you thinking something different with the error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we also update the second and third errors to show the server URL with which we're trying to connect

Since those two are used during or right after inputing the URL I don't think it is necessary to repeat it like that. I could be more convinced on the second, but then I worry about error length.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For this error it does include "could not access the server" which to me covers the case where the server is down. Were you thinking something different with the error?

Fair enough.

Since those two are used during or right after inputting the URL, I don't think it is necessary to repeat it like that. I could be more convinced on the second, but then I worry about error length.

You are correct in that connectivity to the URL has been verified when we get to this step. So when we fail here, the API key may no longer be valid or our validation of the server URL has issues. I think it would be useful to have the server URL present if I were trying to track it down (I think instant visual validation might help), and I'm more interested in providing the information to the user rather than the brevity of the error message. But I'm not strongly tied to this, I'll leave it to you to weigh the benefits and costs.

@dotNomad dotNomad requested a review from sagerb January 23, 2025 18:03
Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

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

I'm good with whatever you decide regarding my concerns. Thanks for considering them.

@dotNomad dotNomad merged commit eb1bfe0 into main Jan 27, 2025
14 checks passed
@dotNomad dotNomad deleted the dotnomad/server-down-err branch January 27, 2025 17:36
@marcosnav
Copy link
Collaborator

Verified! Marking issue as Done
Screen Shot 2025-01-27 at 15 14 33

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.

Error when the Connect server is down is not descriptive
3 participants