use thiserror::Error;
#[derive(Debug, Error)]
pub enum ReaderError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("format error: {0}")]
Format(#[from] coip_format::FormatError),
#[error("missing required section: {0}")]
MissingSection(&'static str),
#[error("unsupported codec: {0:?}")]
UnsupportedCodec(coip_format::Codec),
#[error("decompression error: {0}")]
Decompression(String),
#[error("metadata JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("invalid projection path: {0}")]
InvalidProjection(String),
#[error("corrupt data: {0}")]
Corrupt(String),
#[cfg(feature = "serde")]
#[error("serde deserialization error: {0}")]
Serde(String),
}
pub type Result<T> = std::result::Result<T, ReaderError>;