From 4357358ec6290a682ea0da9cc701d9ab0d17f798 Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 29 Jun 2022 19:20:25 -0400 Subject: [PATCH] xfer --- veilid-core/src/network_manager/native/protocol/ws.rs | 4 ++-- veilid-core/src/network_manager/wasm/protocol/ws.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/veilid-core/src/network_manager/native/protocol/ws.rs b/veilid-core/src/network_manager/native/protocol/ws.rs index 72179b53..4f78fda0 100644 --- a/veilid-core/src/network_manager/native/protocol/ws.rs +++ b/veilid-core/src/network_manager/native/protocol/ws.rs @@ -78,8 +78,8 @@ where pub async fn recv(&self) -> Result, String> { let out = match self.stream.clone().next().await { Some(Ok(Message::Binary(v))) => v, - Some(Ok(_)) => { - return Err("Unexpected WS message type".to_owned()).map_err(logthru_net!(error)); + Some(Ok(x)) => { + return Err(format!("Unexpected WS message type: {:?}", x)); } Some(Err(e)) => { return Err(e.to_string()).map_err(logthru_net!(error)); diff --git a/veilid-core/src/network_manager/wasm/protocol/ws.rs b/veilid-core/src/network_manager/wasm/protocol/ws.rs index 96f8b480..88d156f0 100644 --- a/veilid-core/src/network_manager/wasm/protocol/ws.rs +++ b/veilid-core/src/network_manager/wasm/protocol/ws.rs @@ -56,9 +56,8 @@ impl WebsocketNetworkConnection { pub async fn recv(&self) -> Result, String> { let out = match self.inner.ws_stream.clone().next().await { Some(WsMessage::Binary(v)) => v, - Some(_) => { - return Err("Unexpected WS message type".to_owned()) - .map_err(logthru_net!(error)); + Some(x) => { + return Err(format!("Unexpected WS message type: {:?}", x)); } None => { return Err("WS stream closed".to_owned()).map_err(logthru_net!(error));