From 73b1187c8c0862df536912cfafa4e50da2d6f310 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Tue, 31 May 2022 10:30:13 +1000 Subject: [PATCH] Improve cassandra_connection panic message (#663) --- shotover-proxy/tests/helpers/cassandra.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shotover-proxy/tests/helpers/cassandra.rs b/shotover-proxy/tests/helpers/cassandra.rs index 03c0d32ca..19f30c44e 100644 --- a/shotover-proxy/tests/helpers/cassandra.rs +++ b/shotover-proxy/tests/helpers/cassandra.rs @@ -10,7 +10,9 @@ pub fn cassandra_connection(contact_points: &str, port: u16) -> Session { cluster.set_credentials("cassandra", "cassandra").unwrap(); cluster.set_port(port).ok(); cluster.set_load_balance_round_robin(); - cluster.connect().unwrap() + // By default unwrap uses the Debug formatter `{:?}` which is extremely noisy for the error type returned by `connect()`. + // So we instead force the Display formatter `{}` on the error. + cluster.connect().map_err(|err| format!("{err}")).unwrap() } #[derive(Debug, Clone, PartialOrd, PartialEq, Eq, Ord)]