kona_driver/
errors.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! Contains driver-related error types.

use kona_derive::errors::PipelineErrorKind;
use maili_protocol::FromBlockError;
use thiserror::Error;

/// A [Result] type for the [DriverError].
pub type DriverResult<T, E> = Result<T, DriverError<E>>;

/// Driver error.
#[derive(Error, Debug)]
pub enum DriverError<E>
where
    E: core::error::Error,
{
    /// Pipeline error.
    #[error("Pipeline error: {0}")]
    Pipeline(#[from] PipelineErrorKind),
    /// An error returned by the executor.
    #[error("Executor error: {0}")]
    Executor(E),
    /// An error returned by the conversion from a block to an [maili_protocol::L2BlockInfo].
    #[error("From block error: {0}")]
    FromBlock(#[from] FromBlockError),
    /// Error decoding or encoding RLP.
    #[error("RLP error: {0}")]
    Rlp(alloy_rlp::Error),
}