return error when cannot join the cluster

This commit is contained in:
Xiang Li 2013-07-10 16:25:37 -07:00
parent 01e5d41f91
commit 2eda27e9f4

View File

@ -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 {