Skip to main content

bitwarden_pam/
error.rs

1use bitwarden_core::MissingFieldError;
2use thiserror::Error;
3
4/// Errors from decoding a PAM server response into a domain view.
5///
6/// Shared by the access request, approval and lease clients, which each wrap it in their own
7/// error type.
8#[derive(Debug, Error)]
9pub enum PamDecodeError {
10    /// The server response was missing a field required to build the requested type.
11    #[error(transparent)]
12    MissingField(#[from] MissingFieldError),
13    /// The server returned an access-request decider kind this SDK version does not recognize.
14    #[error("The server returned an unrecognized access-request decider kind")]
15    UnrecognizedDeciderKind,
16    /// A date field in the server response could not be parsed.
17    #[error(transparent)]
18    Chrono(#[from] chrono::ParseError),
19}