From 315ac4838deec21859cc315c319ffb1f5b4e2393 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 25 Jan 2023 14:59:11 -0800 Subject: [PATCH] include code in the error message --- web3_proxy/src/bin/web3_proxy_cli/sentryd/compare.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/bin/web3_proxy_cli/sentryd/compare.rs b/web3_proxy/src/bin/web3_proxy_cli/sentryd/compare.rs index 3e6cb89f..30de22fa 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/sentryd/compare.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/sentryd/compare.rs @@ -60,6 +60,8 @@ pub async fn main( .context(format!("error querying block from {}", rpc)) .map_err(|x| error_builder.build(x))?; + // TODO: if !a.status().is_success() + // TODO: capture response headers now in case of error. store them in the extra data on the pager duty alert let headers = format!("{:#?}", a.headers()); @@ -74,7 +76,7 @@ pub async fn main( } else if let Some(err) = a.error { return error_builder.result( anyhow::anyhow!("headers: {:#?}. err: {:#?}", headers, err) - .context(format!("jsonrpc error from {}", rpc)), + .context(format!("jsonrpc error from {}: code {}", rpc, err.code)), ); } else { return error_builder