From 491282c8ed8495efff96a511ea1d512a706bdeeb Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 9 Jan 2023 18:48:42 +0000 Subject: [PATCH] blocks: Debug new error type Signed-off-by: Alexandru Vasile --- subxt/src/blocks/block_types.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index 69d2df0684..5f04c2476c 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -11,7 +11,10 @@ use crate::{ BlockError, Error, }, - events::{self, Events}, + events::{ + self, + Events, + }, metadata::DecodeWithMetadata, rpc::{ types::{ @@ -67,18 +70,24 @@ where } /// Error resulted from the [`ChainHeadBlock`] methods. +#[derive(Debug, thiserror::Error)] pub enum ChainHeadError { /// The resources requested are inaccessible. /// /// Resubmitting the request later might succeed. + #[error("Inaccessible: {0}")] Inaccessible(String), /// The chain encountered an error. This is definitive. + #[error("Error: {0}")] Error(String), /// The provided subscription ID is stale or invalid. + #[error("Disjoint")] Disjoint, /// The RPC target node does not contain the given resource. + #[error("Resource does not exist on the RPC target node")] ResourceNonExistent, /// An error occurred internally. This is definitive. + #[error("Other: {0}")] Other(String), }