From 2652f88f52bf8f5e01cdca2f10f82bae056f27f8 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 14 Apr 2023 03:43:49 -0700 Subject: [PATCH] attach more contexts --- web3_proxy/src/rpcs/one.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web3_proxy/src/rpcs/one.rs b/web3_proxy/src/rpcs/one.rs index ae196bd4..51ddfe0d 100644 --- a/web3_proxy/src/rpcs/one.rs +++ b/web3_proxy/src/rpcs/one.rs @@ -537,7 +537,8 @@ impl Web3Rpc { // trace!("waiting on chain id for {}", self); let found_chain_id: Result = self .wait_for_request_handle(&authorization, None, unlocked_provider.clone()) - .await? + .await + .context(format!("waiting for request handle on {}", self))? .request( "eth_chainId", &json!(Option::None::<()>), @@ -560,18 +561,20 @@ impl Web3Rpc { } } Err(e) => { - return Err(anyhow::Error::from(e)); + return Err(anyhow::Error::from(e) + .context(format!("unable to parse eth_chainId from {}", self))); } } self.check_block_data_limit(&authorization, unlocked_provider.clone()) - .await?; + .await + .context(format!("unable to parse eth_chainId from {}", self))?; drop(unlocked_provider); info!("successfully connected to {}", self); } else if self.provider.read().await.is_none() { - return Err(anyhow!("failed waiting for client")); + return Err(anyhow!("failed waiting for client {}", self)); }; Ok(())