kona_driver/
errors.rs

1//! Contains driver-related error types.
2
3use kona_derive::PipelineErrorKind;
4use kona_protocol::FromBlockError;
5use thiserror::Error;
6
7/// A [`Result`] type for the [`DriverError`].
8pub type DriverResult<T, E> = Result<T, DriverError<E>>;
9
10/// Driver error.
11#[derive(Error, Debug)]
12pub enum DriverError<E>
13where
14    E: core::error::Error,
15{
16    /// Pipeline error.
17    #[error("Pipeline error: {0}")]
18    Pipeline(#[from] PipelineErrorKind),
19    /// An error returned by the executor.
20    #[error("Executor error: {0}")]
21    Executor(E),
22    /// An error returned by the conversion from a block to an [`kona_protocol::L2BlockInfo`].
23    #[error("From block error: {0}")]
24    FromBlock(#[from] FromBlockError),
25    /// Error decoding or encoding RLP.
26    #[error("RLP error: {0}")]
27    Rlp(alloy_rlp::Error),
28}