Skip to main content

fuel_core_compression_service/
errors.rs

1use fuel_core_storage::Error as StorageError;
2use thiserror::Error;
3
4/// Errors that can occur during compression
5#[derive(Error, Debug)]
6pub enum CompressionError {
7    // L2 block source Errors
8    /// Failed to get l2 block
9    #[error("failed to get l2 block: `{0}`")]
10    FailedToGetBlock(String),
11    // Compression storage Errors
12    /// Failed to read compressed block from storage
13    #[error("failed to write compressed block to storage: `{0}`")]
14    FailedToWriteCompressedBlock(StorageError),
15    /// Failed to write registrations to storage
16    #[error("failed to write registrations to storage: `{0}`")]
17    FailedToWriteRegistrations(StorageError),
18    /// Failed to get the size of compressed block
19    #[error("failed to get size of compressed block: `{0}`")]
20    FailedToGetCompressedBlockSize(StorageError),
21    /// Failed to commit storage transaction
22    #[error("failed to commit transaction: `{0}`")]
23    FailedToCommitTransaction(StorageError),
24    /// Failed to get latest height from storage
25    #[error("failed to get latest height from storage: `{0}`")]
26    FailedToGetLatestHeight(StorageError),
27    // Configuration Errors
28    /// Failed to get config
29    #[error("failed to get configuration: `{0}`")]
30    FailedToGetConfig(String),
31    // Service errors
32    /// Failed to create service
33    #[error("failed to create service: `{0}`")]
34    FailedToCreateService(String),
35    /// Failed to compress block
36    #[error("failed to compress block: `{0}`")]
37    FailedToCompressBlock(anyhow::Error),
38    /// Failed to compute registry root
39    #[error("failed to compute registry root: `{0}`")]
40    FailedToComputeRegistryRoot(StorageError),
41    /// Failed to handle new block
42    #[error("failed to handle new block: `{0}`")]
43    FailedToHandleNewBlock(String),
44    /// Failed to get the sync status of the storages
45    #[error("failed to get sync status")]
46    FailedToGetSyncStatus,
47}