refactor: small refactoring and documentation in interfaces crate (#5866)

This commit is contained in:
Thomas Coratger
2023-12-27 15:02:10 +01:00
committed by GitHub
parent 3aa718a561
commit 68b174e088
3 changed files with 128 additions and 43 deletions

View File

@@ -12,27 +12,37 @@ use reth_primitives::fs::FsPathError;
pub type RethResult<T> = Result<T, RethError>;
/// Core error variants possible when interacting with the blockchain.
///
/// This enum encapsulates various error types that can occur during blockchain interactions.
///
/// It allows for structured error handling based on the nature of the encountered issue.
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
#[allow(missing_docs)]
pub enum RethError {
/// Error encountered during block execution.
#[error(transparent)]
Execution(#[from] BlockExecutionError),
/// Consensus-related errors.
#[error(transparent)]
Consensus(#[from] ConsensusError),
/// Database-related errors.
#[error(transparent)]
Database(#[from] DatabaseError),
/// Errors originating from providers.
#[error(transparent)]
Provider(#[from] ProviderError),
/// Errors related to networking.
#[error(transparent)]
Network(#[from] NetworkError),
/// Canonical errors encountered.
#[error(transparent)]
Canonical(#[from] CanonicalError),
/// Custom error message.
#[error("{0}")]
Custom(String),
}