mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: rewrite all error messages for consistency (#5176)
Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
This commit is contained in:
@ -13,13 +13,13 @@ pub type BeaconEngineResult<Ok> = Result<Ok, BeaconConsensusEngineError>;
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum BeaconConsensusEngineError {
|
||||
/// Pipeline channel closed.
|
||||
#[error("Pipeline channel closed")]
|
||||
#[error("pipeline channel closed")]
|
||||
PipelineChannelClosed,
|
||||
/// Pipeline error.
|
||||
#[error(transparent)]
|
||||
Pipeline(#[from] Box<PipelineError>),
|
||||
/// Pruner channel closed.
|
||||
#[error("Pruner channel closed")]
|
||||
#[error("pruner channel closed")]
|
||||
PrunerChannelClosed,
|
||||
/// Hook error.
|
||||
#[error(transparent)]
|
||||
@ -50,7 +50,7 @@ impl From<reth_interfaces::db::DatabaseError> for BeaconConsensusEngineError {
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum BeaconForkChoiceUpdateError {
|
||||
/// Thrown when a forkchoice update resulted in an error.
|
||||
#[error("Forkchoice update error: {0}")]
|
||||
#[error("forkchoice update error: {0}")]
|
||||
ForkchoiceUpdateError(#[from] ForkchoiceUpdateError),
|
||||
/// Internal errors, for example, error while reading from the database.
|
||||
#[error(transparent)]
|
||||
|
||||
@ -102,13 +102,13 @@ pub enum EngineHookAction {}
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum EngineHookError {
|
||||
/// Hook channel closed.
|
||||
#[error("Hook channel closed")]
|
||||
#[error("hook channel closed")]
|
||||
ChannelClosed,
|
||||
/// Common error. Wrapper around [RethError].
|
||||
#[error(transparent)]
|
||||
Common(#[from] RethError),
|
||||
/// An internal error occurred.
|
||||
#[error("Internal hook error occurred.")]
|
||||
#[error(transparent)]
|
||||
Internal(#[from] Box<dyn std::error::Error + Send + Sync>),
|
||||
}
|
||||
|
||||
|
||||
@ -868,7 +868,7 @@ where
|
||||
head_block.total_difficulty =
|
||||
self.blockchain.header_td_by_number(head_block.number)?.ok_or_else(|| {
|
||||
RethError::Provider(ProviderError::TotalDifficultyNotFound {
|
||||
number: head_block.number,
|
||||
block_number: head_block.number,
|
||||
})
|
||||
})?;
|
||||
self.sync_state_updater.update_status(head_block);
|
||||
|
||||
Reference in New Issue
Block a user