mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl/command: print more details about ErrNoEndpoint
This commit prints more details if getting ErrNoEndpoint when sync with cluster. This helps users to know what happens.
This commit is contained in:
parent
57b39aca4e
commit
c2caa4ae3b
@ -221,6 +221,10 @@ func mustNewClient(c *cli.Context) client.Client {
|
|||||||
err := hc.Sync(ctx)
|
err := hc.Sync(ctx)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == client.ErrNoEndpoints {
|
||||||
|
fmt.Fprintf(os.Stderr, "etcd cluster has no published client endpoints.\n")
|
||||||
|
fmt.Fprintf(os.Stderr, "Try '--no-sync' if you want to access non-published client endpoints(%s).\n", strings.Join(eps, ","))
|
||||||
|
}
|
||||||
handleError(ExitServerError, err)
|
handleError(ExitServerError, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user