Skip to content

Commit

Permalink
A bit more informational errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed May 22, 2015
1 parent bf12b0a commit 3fff37b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dcron/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}

Expand Down

0 comments on commit 3fff37b

Please sign in to comment.