bitwarden_vault/
error.rs

1use bitwarden_error::bitwarden_error;
2use thiserror::Error;
3
4/// Generic error type for vault encryption errors.
5#[allow(missing_docs)]
6#[bitwarden_error(flat)]
7#[derive(Debug, Error)]
8pub enum EncryptError {
9    #[error(transparent)]
10    Crypto(#[from] bitwarden_crypto::CryptoError),
11    #[error("Client User Id has not been set")]
12    MissingUserId,
13}
14
15/// Generic error type for decryption errors
16#[allow(missing_docs)]
17#[bitwarden_error(flat)]
18#[derive(Debug, Error)]
19pub enum DecryptError {
20    #[error(transparent)]
21    Crypto(#[from] bitwarden_crypto::CryptoError),
22}
23
24#[allow(missing_docs)]
25#[derive(Debug, Error)]
26pub enum VaultParseError {
27    #[error(transparent)]
28    Chrono(#[from] chrono::ParseError),
29    #[error(transparent)]
30    Crypto(#[from] bitwarden_crypto::CryptoError),
31    #[error(transparent)]
32    MissingField(#[from] bitwarden_core::MissingFieldError),
33}