Browse Source

return error when cannot join the cluster

Xiang Li 12 years ago
parent
commit
2eda27e9f4
1 changed files with 3 additions and 0 deletions
  1. 3 0
      etcd.go

+ 3 - 0
etcd.go

@@ -501,6 +501,9 @@ func joinCluster(s *raft.Server, serverName string) error {
 	resp, err := t.Post(fmt.Sprintf("%s/join", serverName), &b)
 
 	for {
+		if err != nil {
+			return fmt.Errorf("Unable to join: %v", err)
+		}
 		if resp != nil {
 			defer resp.Body.Close()
 			if resp.StatusCode == http.StatusOK {