discovery: print out detailed cluster error

Conflicts:
	discovery/discovery.go
This commit is contained in:
Xiang Li
2015-07-29 23:04:12 +08:00
committed by Yicheng Qin
parent 97605046c1
commit 3a346eac25
2 changed files with 17 additions and 4 deletions

View File

@ -14,6 +14,8 @@
package client
import "fmt"
type ClusterError struct {
Errors []error
}
@ -21,3 +23,11 @@ type ClusterError struct {
func (ce *ClusterError) Error() string {
return ErrClusterUnavailable.Error()
}
func (ce *ClusterError) Detail() string {
s := ""
for i, e := range ce.Errors {
s += fmt.Sprintf("error #%d: %s\n", i, e)
}
return s
}