Skip to content

Commit

Permalink
add a connection failure string
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Nov 29, 2024
1 parent 4e1b78e commit 486a569
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/sdk-common/src/tonic_wrap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ impl Display for Status {

pub struct TransportError(pub tonic::transport::Error);

const BROKEN_CONNECTION_STRINGS: [&str; 2] = [
const BROKEN_CONNECTION_STRINGS: [&str; 3] = [
"http2 error: keep-alive timed out",
"connection error: address not available",
"connection error: timed out",
];

impl Display for TransportError {
Expand Down Expand Up @@ -77,7 +78,7 @@ where
// It's a bit of a guess which errors can occur here. hyper Io errors start
// with 'connection error'. These are some of the errors seen before.
if !BROKEN_CONNECTION_STRINGS.contains(&source.to_string().as_str()) {
debug!("transport error string is: {}", source.to_string());
debug!("transport error string is: '{}'", source.to_string());
return Err(status);
}

Expand Down

0 comments on commit 486a569

Please sign in to comment.