core_crypto/mls/credential/
error.rs

1//! MLS credential errors
2
3// We allow missing documentation in the error module because the types are generally self-descriptive.
4#![allow(missing_docs)]
5
6pub(crate) type Result<T, E = Error> = core::result::Result<T, E>;
7
8#[derive(Debug, thiserror::Error)]
9pub enum Error {
10    #[error("decoding X509 certificate")]
11    DecodeX509(#[source] x509_cert::der::Error),
12    #[error("client presented an invalid identity")]
13    InvalidIdentity,
14    /// Unsupported credential type.
15    ///
16    /// Supported credential types:
17    ///
18    /// - basic
19    /// - x509
20    #[error("unsupported credential type")]
21    UnsupportedCredentialType,
22    /// This operation is not supported.
23    ///
24    /// There are some operations which must be implemented to satisfy a trait,
25    /// but for which we cannot offer a real implementation. Those raise this error.
26    ///
27    /// Where possible, a short workaround is included.
28    #[error("unsupported operation. prefer `{0}`")]
29    UnsupportedOperation(&'static str),
30    #[error("unsupported algorithm")]
31    UnsupportedAlgorithm,
32    #[error(transparent)]
33    Keystore(#[from] crate::KeystoreError),
34    #[error(transparent)]
35    Mls(#[from] crate::MlsError),
36    #[error(transparent)]
37    Recursive(#[from] crate::RecursiveError),
38}