Skip to content

Commit

Permalink
Improve cassandra_connection panic message (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored May 31, 2022
1 parent b7f1dca commit 73b1187
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shotover-proxy/tests/helpers/cassandra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 73b1187

Please sign in to comment.