mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
discovery: return bad discovery endpoint error
This commit is contained in:
parent
d2dac0fe59
commit
d9c27138fa
@ -37,14 +37,15 @@ import (
|
||||
var (
|
||||
plog = capnslog.NewPackageLogger("github.com/coreos/etcd", "discovery")
|
||||
|
||||
ErrInvalidURL = errors.New("discovery: invalid URL")
|
||||
ErrBadSizeKey = errors.New("discovery: size key is bad")
|
||||
ErrSizeNotFound = errors.New("discovery: size key not found")
|
||||
ErrTokenNotFound = errors.New("discovery: token not found")
|
||||
ErrDuplicateID = errors.New("discovery: found duplicate id")
|
||||
ErrDuplicateName = errors.New("discovery: found duplicate name")
|
||||
ErrFullCluster = errors.New("discovery: cluster is full")
|
||||
ErrTooManyRetries = errors.New("discovery: too many retries")
|
||||
ErrInvalidURL = errors.New("discovery: invalid URL")
|
||||
ErrBadSizeKey = errors.New("discovery: size key is bad")
|
||||
ErrSizeNotFound = errors.New("discovery: size key not found")
|
||||
ErrTokenNotFound = errors.New("discovery: token not found")
|
||||
ErrDuplicateID = errors.New("discovery: found duplicate id")
|
||||
ErrDuplicateName = errors.New("discovery: found duplicate name")
|
||||
ErrFullCluster = errors.New("discovery: cluster is full")
|
||||
ErrTooManyRetries = errors.New("discovery: too many retries")
|
||||
ErrBadDiscoveryEndpoint = errors.New("discovery: bad discovery endpoint")
|
||||
)
|
||||
|
||||
var (
|
||||
@ -217,6 +218,9 @@ func (d *discovery) checkCluster() ([]*client.Node, int, uint64, error) {
|
||||
if eerr, ok := err.(*client.Error); ok && eerr.Code == client.ErrorCodeKeyNotFound {
|
||||
return nil, 0, 0, ErrSizeNotFound
|
||||
}
|
||||
if err == client.ErrInvalidJSON {
|
||||
return nil, 0, 0, ErrBadDiscoveryEndpoint
|
||||
}
|
||||
if err == context.DeadlineExceeded {
|
||||
return d.checkClusterRetry()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user