use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("Failed to parse CAR file: {0}")]
ParsingError(String),
#[error("Invalid CAR file: {0}")]
InvalidFile(String),
#[error("Io error: {0}")]
Io(#[from] std::io::Error),
#[error("Cbor encoding error: {0}")]
Cbor(#[from] fvm_ipld_encoding::Error),
#[error("CAR error: {0}")]
Other(String),
}
impl From<cid::Error> for Error {
fn from(err: cid::Error) -> Error {
Error::Other(err.to_string())
}
}
impl From<cid::multihash::Error> for Error {
fn from(err: cid::multihash::Error) -> Error {
Error::ParsingError(err.to_string())
}
}