core_crypto/transaction_context/e2e_identity/
error.rs

1//! End to end identity errors
2
3// We allow missing documentation in the error module because the types are generally self-descriptive.
4#![allow(missing_docs)]
5
6use crate::prelude::MlsCredentialType;
7
8pub type Result<T, E = Error> = core::result::Result<T, E>;
9
10#[derive(Debug, thiserror::Error)]
11pub enum Error {
12    #[error("Incorrect usage of this API")]
13    ImplementationError,
14    #[error("Expected a MLS client with credential type {0:?} but none found")]
15    MissingExistingClient(MlsCredentialType),
16    #[error(
17        "We already have an ACME Root Trust Anchor registered. Cannot proceed but this is usually indicative of double registration and can be ignored"
18    )]
19    TrustAnchorAlreadyRegistered,
20    #[error("PKI Environment must be set before calling this function")]
21    PkiEnvironmentUnset,
22    #[error(transparent)]
23    X509Error(#[from] wire_e2e_identity::prelude::x509::RustyX509CheckError),
24    #[error(transparent)]
25    X509CertDerError(#[from] x509_cert::der::Error),
26    #[error(transparent)]
27    Mls(#[from] crate::MlsError),
28    #[error(transparent)]
29    Keystore(#[from] crate::KeystoreError),
30    #[error(transparent)]
31    Recursive(#[from] crate::RecursiveError),
32}