#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[non_exhaustive]
pub enum DidError {
#[error("missing `did:` scheme prefix")]
MissingScheme,
#[error("invalid method name: unexpected character at byte {position}")]
InvalidMethodName {
position: usize,
},
#[error("method-specific id is empty or ends with `:`")]
EmptyMethodSpecificId,
#[error("invalid character {ch:?} at byte {position}")]
InvalidChar {
position: usize,
ch: char,
},
#[error("incomplete or non-hex percent-encoding at byte {position}")]
InvalidPercentEncoding {
position: usize,
},
#[error("input exceeds the maximum length of {max} bytes")]
TooLong {
max: usize,
},
#[error("invalid DID URL path")]
InvalidPath,
#[error("invalid DID URL query")]
InvalidQuery,
#[error("invalid DID URL fragment")]
InvalidFragment,
}