use thiserror::Error;
#[derive(Debug, Error)]
pub enum CompressionError {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Invalid parameter: {0}")]
InvalidParameter(String),
#[error("Decompression failed: {0}")]
DecompressionFailed(String),
#[error("Proof generation failed: {0}")]
ProofFailed(String),
#[error("DHT storage error: {0}")]
DhtError(String),
#[error("Shard not found: {0:?}")]
ShardNotFound([u8; 32]),
#[error("Invalid shard format: {0}")]
InvalidShard(String),
}
pub type Result<T> = std::result::Result<T, CompressionError>;