blocks: Debug new error type

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-01-09 18:48:42 +00:00
parent f0224fcafb
commit 491282c8ed
+10 -1
View File
@@ -11,7 +11,10 @@ use crate::{
BlockError, BlockError,
Error, Error,
}, },
events::{self, Events}, events::{
self,
Events,
},
metadata::DecodeWithMetadata, metadata::DecodeWithMetadata,
rpc::{ rpc::{
types::{ types::{
@@ -67,18 +70,24 @@ where
} }
/// Error resulted from the [`ChainHeadBlock`] methods. /// Error resulted from the [`ChainHeadBlock`] methods.
#[derive(Debug, thiserror::Error)]
pub enum ChainHeadError { pub enum ChainHeadError {
/// The resources requested are inaccessible. /// The resources requested are inaccessible.
/// ///
/// Resubmitting the request later might succeed. /// Resubmitting the request later might succeed.
#[error("Inaccessible: {0}")]
Inaccessible(String), Inaccessible(String),
/// The chain encountered an error. This is definitive. /// The chain encountered an error. This is definitive.
#[error("Error: {0}")]
Error(String), Error(String),
/// The provided subscription ID is stale or invalid. /// The provided subscription ID is stale or invalid.
#[error("Disjoint")]
Disjoint, Disjoint,
/// The RPC target node does not contain the given resource. /// The RPC target node does not contain the given resource.
#[error("Resource does not exist on the RPC target node")]
ResourceNonExistent, ResourceNonExistent,
/// An error occurred internally. This is definitive. /// An error occurred internally. This is definitive.
#[error("Other: {0}")]
Other(String), Other(String),
} }