mirror of
https://github.com/openziti/ziti.git
synced 2026-10-12 07:18:36 +00:00
Merge pull request #1969 from Vrashabh-Sontakke/patch-1
Enhance Identity Existance Checks with Improved Error Handling
This commit is contained in:
@@ -247,7 +247,11 @@ func LoadSelectedIdentity() (RestClientIdentity, error) {
|
||||
id := config.GetIdentity()
|
||||
clientIdentity, found := config.EdgeIdentities[id]
|
||||
if !found {
|
||||
return nil, errors.Errorf("no identity '%v' found in cli config %v", id, configFile)
|
||||
if len(config.EdgeIdentities) == 0 {
|
||||
return nil, errors.New("no identities found in CLI config. Please log in using 'ziti edge login' command")
|
||||
} else {
|
||||
return nil, errors.Errorf("no identity '%v' found in CLI config %v. You can select an existing identity using 'ziti edge use <identity_name>'", id, configFile)
|
||||
}
|
||||
}
|
||||
selectedIdentity = clientIdentity
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user