diff --git a/dcron/etcd.go b/dcron/etcd.go index 1638159d4..aa58328e9 100644 --- a/dcron/etcd.go +++ b/dcron/etcd.go @@ -81,7 +81,12 @@ func (e *etcdClient) GetExecutions() ([]*Execution, error) { func (e *etcdClient) GetLeader() string { res, err := e.Client.Get(keyspace+"/leader", false, false) if err != nil { - log.Debug(err) + if eerr, ok := err.(*etcdc.EtcdError); ok { + if eerr.ErrorCode == 501 { + log.Panic(err) + } + } + log.Error(err.Error()) return "" }