From 4a78c4b73fe47f89cdfba238c119e0c9417fab5c Mon Sep 17 00:00:00 2001 From: Samuel Onoja Date: Tue, 12 Nov 2024 07:02:21 +0100 Subject: [PATCH] debug connection closed --- relay_client/src/websocket/connection.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/relay_client/src/websocket/connection.rs b/relay_client/src/websocket/connection.rs index 0e7e605..09f97b7 100644 --- a/relay_client/src/websocket/connection.rs +++ b/relay_client/src/websocket/connection.rs @@ -81,14 +81,15 @@ pub async fn connection_event_loop( } StreamEvent::InboundError(error) => { + println!("err: {error:?}"); if let ClientError::WebsocketClient(WebsocketClientError::Transport(err)) = &error { - if err.to_string().contains("Operation timed out") { + let err_str = err.to_string(); + if err_str.contains("Operation timed out") || err_str.contains("unexpected end of file") { + handler.disconnected(None); conn.reset(); }; - if err.to_string().contains("unexpected end of file") { - conn.reset(); - } + println!("done resetting"); } handler.inbound_error(error); }