identity_credential/sd_jwt_vc/
error.rsuse serde_json::Value;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("missing required claim \"{0}\"")]
MissingClaim(&'static str),
#[error("claim \"{0}\" cannot be disclosed")]
DisclosedClaim(&'static str),
#[error("invalid value for claim \"{name}\"; expected value of type {expected}, but {found} was found")]
InvalidClaimValue {
name: &'static str,
expected: &'static str,
found: Value,
},
#[error(transparent)]
SdJwt(#[from] sd_jwt_payload_rework::Error),
#[error("invalid \"typ\" value; expected \"vc+sd-jwt\" (or a superset) but found \"{0}\"")]
InvalidJoseType(String),
#[error("failed to resolve \"{input}\"")]
Resolution {
input: String,
#[source]
source: super::resolver::Error,
},
#[error("invalid Issuer Metadata: {0}")]
InvalidIssuerMetadata(#[source] anyhow::Error),
#[error("invalid Type Metadata: {0}")]
InvalidTypeMetadata(#[source] anyhow::Error),
#[error("credential validation failed: {0}")]
Validation(#[source] anyhow::Error),
#[error("verification failed: {0}")]
Verification(#[source] anyhow::Error),
}
pub type Result<T> = std::result::Result<T, Error>;