Browse Source

Yell about un-thought-about config values.

Burke Libbey 12 years ago
parent
commit
732652bf64
1 changed files with 6 additions and 2 deletions
  1. 6 2
      client.go

+ 6 - 2
client.go

@@ -41,8 +41,12 @@ func NewClient(id string, addrs []string, config *ClientConfig) (*Client, error)
 		config = new(ClientConfig)
 		config = new(ClientConfig)
 	}
 	}
 
 
-	if config.MetadataRetries < 0 {
-		return nil, ConfigurationError("Invalid MetadataRetries")
+	if config.MetadataRetries <= 0 {
+		return nil, ConfigurationError("Invalid MetadataRetries. Try 10")
+	}
+
+	if config.WaitForElection <= time.Duration(0) {
+		return nil, ConfigurationError("Invalid WaitForElection. Try 250*time.Millisecond")
 	}
 	}
 
 
 	if config.ConcurrencyPerBroker < 0 {
 	if config.ConcurrencyPerBroker < 0 {