Skip to main content

did_scid/
errors.rs

1use didwebvh_rs::DIDWebVHError;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5#[non_exhaustive]
6pub enum DIDSCIDError {
7    /// A `did:webs` resolution failed.
8    #[error("did:webs error: {0}")]
9    WebsError(String),
10
11    /// The DID names a `did:scid` format this implementation does not
12    /// resolve. Distinct from [`Self::UnsupportedFormat`], which means the
13    /// string is not a `did:scid` at all.
14    #[error("unknown did:scid format: {0}")]
15    UnknownFormat(String),
16
17    /// The DID names a format version this implementation does not resolve.
18    #[error("unsupported did:scid version: {0}")]
19    UnsupportedVersion(String),
20
21    #[error("Unsupported format")]
22    UnsupportedFormat,
23    #[error("DID URL Error: {0}")]
24    DidUrlError(String),
25    #[error("Invalid src parameter: {0}")]
26    InvalidSrc(String),
27    #[error("WebVH error")]
28    WebVHError(#[from] DIDWebVHError),
29    #[error("Cheqd error: {0}")]
30    CheqdError(String),
31    #[error("Is a peer SCID DID, but no peer source information provided")]
32    MissingPeerSource,
33    #[error("Serialization/Deserializaton error occurred")]
34    SerdeError(#[from] serde_json::Error),
35}