From 486a5699226b39fe402e0ecef1eb7b1ac25f07d3 Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Fri, 29 Nov 2024 23:19:35 +0100 Subject: [PATCH] add a connection failure string --- libs/sdk-common/src/tonic_wrap/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/sdk-common/src/tonic_wrap/mod.rs b/libs/sdk-common/src/tonic_wrap/mod.rs index 45e2f6e43..61b94807c 100644 --- a/libs/sdk-common/src/tonic_wrap/mod.rs +++ b/libs/sdk-common/src/tonic_wrap/mod.rs @@ -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 { @@ -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); }