wire_e2e_identity/acme/
error.rs

1/// Wrapper over a [Result] with a [RustyAcmeError] error
2pub type RustyAcmeResult<T> = Result<T, RustyAcmeError>;
3
4/// All errors which [crate::RustyAcme] might throw
5#[derive(Debug, thiserror::Error)]
6pub enum RustyAcmeError {
7    /// Invalid Json representation
8    #[error(transparent)]
9    JsonError(#[from] serde_json::Error),
10    /// Invalid URL
11    #[error(transparent)]
12    UrlError(#[from] url::ParseError),
13    /// Error while building a JWT
14    #[error(transparent)]
15    JwtError(#[from] rusty_jwt_tools::prelude::RustyJwtError),
16    /// Error related to various X509 processing facilities/tools/checks
17    #[error(transparent)]
18    X509CheckError(#[from] crate::x509_check::RustyX509CheckError),
19    /// Failed mapping an ASN.1 ObjectIdentifier
20    #[error(transparent)]
21    OidError(#[from] x509_cert::der::oid::Error),
22    /// Failed mapping a DER certificate
23    #[error(transparent)]
24    DerError(#[from] x509_cert::der::Error),
25    /// Error while parsing a PEM document
26    #[error(transparent)]
27    PemError(#[from] pem::PemError),
28    /// Error while handling a JWT
29    #[error(transparent)]
30    RawJwtError(#[from] jwt_simple::Error),
31    /// Error with hand-rolled signature
32    #[error(transparent)]
33    SignatureError(#[from] signature::Error),
34    /// We have done something terribly wrong
35    #[error("We have done something terribly wrong and it needs to be fixed")]
36    ImplementationError,
37    /// Mostly related to WASM support
38    #[error("Requested functionality is not supported for the moment")]
39    NotSupported,
40    /// This library has been used the wrong way by users
41    #[error("This library has been used the wrong way by users because {0}")]
42    ClientImplementationError(&'static str),
43    /// Smallstep ACME server is not correctly implemented
44    #[error("Incorrect response from ACME server because {0}")]
45    SmallstepImplementationError(&'static str),
46    /// Error while processing an account
47    #[error(transparent)]
48    AccountError(#[from] crate::acme::account::AcmeAccountError),
49    /// Error while processing an order
50    #[error(transparent)]
51    OrderError(#[from] crate::acme::order::AcmeOrderError),
52    /// Error while processing an authorization
53    #[error(transparent)]
54    AuthzError(#[from] crate::acme::authz::AcmeAuthzError),
55    /// Error while validating a challenge
56    #[error(transparent)]
57    ChallengeError(#[from] crate::acme::chall::AcmeChallError),
58    /// Error while finalizing an order
59    #[error(transparent)]
60    FinalizeError(#[from] crate::acme::finalize::AcmeFinalizeError),
61    /// UTF-8 parsing error
62    #[error(transparent)]
63    Utf8(#[from] std::str::Utf8Error),
64}