use thiserror::Error;
#[derive(Debug, Error)]
pub enum ResolveError {
#[error("invalid DIG URN: {0}")]
Parse(String),
#[error("transport error: {0}")]
Transport(String),
#[error("rpc error: {0}")]
Rpc(String),
#[error("resource not found")]
NotFound,
#[error("a root-pinned URN is required to resolve over the public gateway (rootless URNs are not chain-verified there)")]
RootRequired,
#[error("inclusion verification failed: {0}")]
VerifyFailed(String),
#[error("decryption failed (wrong key/salt or corrupt ciphertext)")]
DecryptFailed,
}
pub type Result<T> = core::result::Result<T, ResolveError>;