From eadf56db3761091bd16601ee4c8c7b4436cf9837 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 1 Oct 2024 17:37:12 +0200 Subject: [PATCH] fix: error message on rpc errors --- lightclient/src/lib.rs | 2 +- subxt/src/backend/rpc/reconnecting_rpc_client/mod.rs | 2 +- subxt/src/error/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightclient/src/lib.rs b/lightclient/src/lib.rs index 3884bf2ab4..24fd8c960f 100644 --- a/lightclient/src/lib.rs +++ b/lightclient/src/lib.rs @@ -43,7 +43,7 @@ pub enum LightClientError { #[derive(Debug, thiserror::Error)] pub enum LightClientRpcError { /// Error response from the JSON-RPC server. - #[error("{0}")] + #[error(transparent)] JsonRpcError(JsonRpcError), /// Smoldot could not handle the RPC call. #[error("Smoldot could not handle the RPC call: {0}.")] diff --git a/subxt/src/backend/rpc/reconnecting_rpc_client/mod.rs b/subxt/src/backend/rpc/reconnecting_rpc_client/mod.rs index 283fe149da..94eeb4b207 100644 --- a/subxt/src/backend/rpc/reconnecting_rpc_client/mod.rs +++ b/subxt/src/backend/rpc/reconnecting_rpc_client/mod.rs @@ -135,7 +135,7 @@ pub enum Error { #[error(transparent)] DisconnectedWillReconnect(#[from] DisconnectedWillReconnect), /// Other rpc error. - #[error("{0}")] + #[error(transparent)] RpcError(RpcError), } diff --git a/subxt/src/error/mod.rs b/subxt/src/error/mod.rs index c66dbd6868..44a4283c09 100644 --- a/subxt/src/error/mod.rs +++ b/subxt/src/error/mod.rs @@ -37,7 +37,7 @@ pub enum Error { #[error("Scale codec error: {0}")] Codec(#[from] codec::Error), /// Rpc error. - #[error("Rpc error: {0}")] + #[error(transparent)] Rpc(#[from] RpcError), /// Serde serialization error #[error("Serde json error: {0}")]