diff --git a/src/ws.rs b/src/ws.rs index 5201dcd9f..1d4755c7b 100644 --- a/src/ws.rs +++ b/src/ws.rs @@ -14,7 +14,7 @@ use tokio_tungstenite::{ MaybeTlsStream, WebSocketStream, }; -use tracing::instrument; +use tracing::{debug, instrument}; use url::Url; pub struct WsStream(WebSocketStream>); @@ -97,7 +97,16 @@ pub(crate) fn convert_ws_message(message: Option) -> Result - unsafe { crate::json::from_str(payload.as_mut_str()) }.map(Some)?, + match unsafe { crate::json::from_str(payload.as_mut_str()) } { + Ok(event) => Some(event), + Err(why) => { + debug!( + "Could not deserialize websocket event, payload: {}, error: {}", + payload, why + ); + None + }, + }, Some(Message::Binary(bytes)) => { return Err(Error::UnexpectedBinaryMessage(bytes)); },