diff --git a/ethers-providers/src/pubsub.rs b/ethers-providers/src/pubsub.rs index 63339437..a31c0dcb 100644 --- a/ethers-providers/src/pubsub.rs +++ b/ethers-providers/src/pubsub.rs @@ -12,6 +12,7 @@ use std::{ pin::Pin, task::{Context, Poll}, }; +use tracing::error; /// A transport implementation supporting pub sub subscriptions. pub trait PubsubClient: JsonRpcClient { @@ -90,7 +91,10 @@ where match futures_util::ready!(this.rx.poll_next(ctx)) { Some(item) => match serde_json::from_str(item.get()) { Ok(res) => Poll::Ready(Some(res)), - _ => Poll::Pending, + Err(err) => { + error!("failed to deserialize item {:?}", err); + Poll::Pending + } }, None => Poll::Ready(None), } diff --git a/ethers-providers/src/transports/ws.rs b/ethers-providers/src/transports/ws.rs index 098a2d87..e43d5ed8 100644 --- a/ethers-providers/src/transports/ws.rs +++ b/ethers-providers/src/transports/ws.rs @@ -22,6 +22,7 @@ use std::{ }, }; use thiserror::Error; +use tracing::trace; use super::common::{Params, Response}; @@ -317,6 +318,7 @@ where } async fn handle_text(&mut self, inner: String) -> Result<(), ClientError> { + trace!(msg=?inner, "received message"); let (id, result) = match serde_json::from_str(&inner)? { Response::Success { id, result } => (id, Ok(result.to_owned())), Response::Error { id, error } => (id, Err(error)),