blob_indexer/slots_processor/
error.rs1use alloy::primitives::B256;
2
3use crate::{clients::common::ClientError, synchronizer::error::SynchronizerError};
4
5#[derive(Debug, thiserror::Error)]
6pub enum SlotProcessingError {
7 #[error(transparent)]
8 ClientError(#[from] crate::clients::common::ClientError),
9 #[error(transparent)]
10 Provider(#[from] alloy::transports::TransportError),
11 #[error(transparent)]
12 Other(#[from] anyhow::Error),
13}
14
15#[derive(Debug, thiserror::Error)]
16pub enum SlotsProcessorError {
17 #[error(
18 "Error processing slots range {initial_slot}-{final_slot}. Slot {failed_slot} failed: {error}"
19 )]
20 FailedSlotsProcessing {
21 initial_slot: u32,
22 final_slot: u32,
23 failed_slot: u32,
24 error: SlotProcessingError,
25 },
26 #[error("Failed to process reorg. old slot {old_slot}, new slot {new_slot}, new head block root {new_head_block_root}, old head block root {old_head_block_root}: {error}")]
27 FailedReorgProcessing {
28 old_slot: u32,
29 new_slot: u32,
30 new_head_block_root: B256,
31 old_head_block_root: B256,
32 #[source]
33 error: anyhow::Error,
34 },
35 #[error("Failed to handle reorged slots")]
36 ReorgedFailure(#[from] ClientError),
37 #[error("Failed to handle forwarded blocks")]
38 ForwardedBlocksFailure(#[from] SynchronizerError),
39 #[error(transparent)]
40 Other(#[from] anyhow::Error),
41}