Skip to main content

lib_compression/
error.rs

1//! Error types for compression operations
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum CompressionError {
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9
10    #[error("Serialization error: {0}")]
11    Serialization(String),
12
13    #[error("Invalid parameter: {0}")]
14    InvalidParameter(String),
15
16    #[error("Decompression failed: {0}")]
17    DecompressionFailed(String),
18
19    #[error("Proof generation failed: {0}")]
20    ProofFailed(String),
21
22    #[error("DHT storage error: {0}")]
23    DhtError(String),
24
25    #[error("Shard not found: {0:?}")]
26    ShardNotFound([u8; 32]),
27
28    #[error("Invalid shard format: {0}")]
29    InvalidShard(String),
30}
31
32pub type Result<T> = std::result::Result<T, CompressionError>;