diff --git a/zenoh-plugin-remote-api/src/lib.rs b/zenoh-plugin-remote-api/src/lib.rs index c57a3db..f1e5fe3 100644 --- a/zenoh-plugin-remote-api/src/lib.rs +++ b/zenoh-plugin-remote-api/src/lib.rs @@ -608,9 +608,13 @@ async fn run_websocket_server( None => Box::new(tcp_stream), }; - let ws_stream = tokio_tungstenite::accept_async(streamable) - .await - .expect("Error during the websocket handshake occurred"); + let ws_stream = match tokio_tungstenite::accept_async(streamable).await { + Ok(ws_stream) => ws_stream, + Err(e) => { + error!("Error during the websocket handshake occurred: {}", e); + return; + } + }; let (ws_tx, ws_rx) = ws_stream.split();