diff --git a/client/client_test.go b/client/client_test.go index 5f00b05d1..aaf2bec47 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -855,7 +855,7 @@ func TestHTTPClusterClientAutoSyncFail(t *testing.T) { } err = hc.AutoSync(context.Background(), time.Hour) - if err.Error() != ErrClusterUnavailable.Error() { + if !strings.HasPrefix(err.Error(), ErrClusterUnavailable.Error()) { t.Fatalf("incorrect error value: want=%v got=%v", ErrClusterUnavailable, err) } } diff --git a/client/cluster_error.go b/client/cluster_error.go index aef5bf755..34618cdbd 100644 --- a/client/cluster_error.go +++ b/client/cluster_error.go @@ -21,7 +21,11 @@ type ClusterError struct { } func (ce *ClusterError) Error() string { - return ErrClusterUnavailable.Error() + s := ErrClusterUnavailable.Error() + for i, e := range ce.Errors { + s += fmt.Sprintf("; error #%d: %s\n", i, e) + } + return s } func (ce *ClusterError) Detail() string {