use iris_format::Digest;
#[derive(Clone, PartialEq, Eq, Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Untrusted {
#[error("the container names no decoder, so nothing here knows how to read it")]
Missing,
#[error(
"the decoder named {name} for this dataset lives outside the container, and this host runs \
embedded decoders only. A host that means to run this one calls \
Policy::with_external_decoders_resolved_by and supplies the bytes, which are hashed \
against the digest the container gives either way."
)]
External {
name: String,
},
#[error("nothing resolved the decoder named {name}, whose module should hash to {digest}")]
Unresolved {
name: String,
digest: Digest,
},
#[error(
"the container puts the decoder named {name} somewhere this build has no idea how to \
reach, so nothing is run"
)]
Elsewhere {
name: String,
},
#[error(
"the container puts its decoder in section {section}, and there is no section {section} \
in the file"
)]
Lost {
section: u32,
},
#[error("the decoder module hashes to {found}, and the container says it should be {expected}")]
Digest {
expected: Digest,
found: Digest,
},
}