frnsys/redis-cluster.rs

new Cluster panic on non-connect

Opened this issue · 0 comments

This unwrap lead to a panic via Cluster::new when it can't connect to the cluster initially.

fn connect(info: &str) -> Connection {
let client = Client::open(info).unwrap();
client.get_connection().unwrap()
}

It would be nice if this could be resilient, but as a rust neophyte, I'm not sure which makes more sense, automatically retrying, swallowing the error until you go to do an actual operation, or having new (or a separate constructor) that returns a Result to enable you to retry.