-
Notifications
You must be signed in to change notification settings - Fork 136
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
provide a better error when the user is not logged in #1772
Comments
I would like to work on this issue. |
That errors comes from here: https://github.com/openziti/ziti/blob/v1.0.0/ziti/util/identities.go#L328 A basic fix would maybe check the identity count and return an error saying you need to login if there are 0 saved logins. Above and beyond that, if the selected saved login isn't found you could output the list of saved logins and let the user know they could either login or use |
Thank you so much @plorenz for the jumpstart. |
This commit enhances the `LoadSelectedIdentity` function in the [identities.go](https://github.com/openziti/ziti/blob/a60ed6ffb6d539664151584ccd01b1740fc4d2b2/ziti/util/identities.go#L241C1-L255C2) file by adding improved error handling and checks for the existence of identities in the CLI configuration. Previously, the function only threw an ambiguous error if the selected identity was not found in the CLI config. However, with this enhancement, the function now checks if there are any saved identities in the CLI config. If no identities are found, it returns an error instructing the user to log in using the `ziti edge login` command. Additionally, if the specified identity is not found, it returns an error message indicating that the identity could not be found in the CLI config and provides instructions on how to select an existing identity using `ziti edge use <identity_name>`. These changes improve the robustness of the function by ensuring that appropriate error messages are provided in scenarios where the user is not logged in or when the selected identity is missing. fixes openziti#1772 thanks to @plorenz
Running
ziti edge list ers
(or anything really) does not provide a CLEAR error to the user indicating they just aren't logged in. The feedback should be much more obvious than what is currently output.See:
☝️ not exactly obvious that they just haven't logged in yet...
The text was updated successfully, but these errors were encountered: