identity_iota_core/
error.rs1pub type Result<T, E = Error> = core::result::Result<T, E>;
6
7#[derive(Debug, thiserror::Error, strum::IntoStaticStr)]
9#[non_exhaustive]
10pub enum Error {
11 #[error("serialization error: {0}")]
13 SerializationError(&'static str, #[source] Option<identity_core::Error>),
14 #[error("invalid did")]
16 DIDSyntaxError(#[source] identity_did::Error),
17 #[error("invalid document")]
19 InvalidDoc(#[source] identity_document::Error),
20 #[error("DID resolution failed; {0}")]
22 DIDResolutionError(String),
23 #[error("\"{0}\" is not a valid network name in the context of the `iota` did method")]
25 InvalidNetworkName(String),
26 #[error("unable to resolve a `{expected}` DID on network `{actual}`")]
28 NetworkMismatch {
29 expected: String,
31 actual: String,
33 },
34 #[error("invalid state metadata {0}")]
36 InvalidStateMetadata(&'static str),
37 #[cfg(feature = "revocation-bitmap")]
38 #[error("credential revocation error")]
40 RevocationError(#[source] identity_credential::revocation::RevocationError),
41 #[error("conversion to an OutputId failed: {0}")]
43 OutputIdConversionError(String),
44 #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))]
45 #[error("JavaScript function threw an exception: {0}")]
47 JsError(String),
48 #[error("jws signature verification failed")]
50 JwsVerificationError(#[source] identity_document::Error),
51}