use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ContentError {
#[error("failed to encode value as canonical dag-cbor: {source}")]
EncodingError {
#[source]
source: serde_ipld_dagcbor::EncodeError<std::collections::TryReserveError>,
},
#[error("failed to decode value from canonical dag-cbor: {source}")]
DecodingError {
#[source]
source: serde_ipld_dagcbor::DecodeError<std::convert::Infallible>,
},
#[error("content verification failed: expected {expected}, computed {computed}")]
VerificationFailed {
expected: String,
computed: String,
},
#[error("invalid CID: {reason}")]
InvalidCid {
reason: String,
},
}