pop_fork/error/
builder.rs1use super::{BlockError, ExecutorError, LocalStorageError, RemoteStorageError};
6use thiserror::Error;
7
8#[derive(Debug, Error)]
10pub enum BlockBuilderError {
11 #[error("Executor error: {0}")]
13 Executor(#[from] ExecutorError),
14
15 #[error("Storage error: {0}")]
17 Storage(#[from] LocalStorageError),
18
19 #[error("Block error: {0}")]
21 Block(#[from] BlockError),
22
23 #[error("Codec error: {0}")]
25 Codec(String),
26
27 #[error("Block not initialized - call initialize() first")]
29 NotInitialized,
30
31 #[error("Block already initialized - initialize() can only be called once")]
33 AlreadyInitialized,
34
35 #[error("Inherents not applied - call apply_inherents() before apply_extrinsic()")]
37 InherentsNotApplied,
38
39 #[error("Inherents already applied - apply_inherents() can only be called once")]
41 InherentsAlreadyApplied,
42 #[error("Block already finalized")]
44 AlreadyFinalized,
45
46 #[error("Inherent provider `{provider}` failed: {message}")]
48 InherentProvider {
49 provider: String,
51 message: String,
53 },
54}
55
56impl From<RemoteStorageError> for BlockBuilderError {
57 fn from(err: RemoteStorageError) -> Self {
58 BlockBuilderError::Storage(LocalStorageError::from(err))
59 }
60}