Skip to main content

bitwarden_collections/
error.rs

1use bitwarden_error::bitwarden_error;
2use thiserror::Error;
3
4#[allow(missing_docs)]
5#[bitwarden_error(flat)]
6#[derive(Debug, Error)]
7pub enum CollectionDecryptError {
8    #[error(transparent)]
9    Crypto(#[from] bitwarden_crypto::CryptoError),
10}
11
12/// Generic error type for collection encryption errors.
13///
14/// This intentionally mirrors `bitwarden_vault::EncryptError` rather than depending on it, to
15/// avoid creating a circular dependency between the `bitwarden-collections` and `bitwarden-vault`
16/// crates.
17#[allow(missing_docs)]
18#[bitwarden_error(flat)]
19#[derive(Debug, Error)]
20pub enum CollectionEncryptError {
21    #[error(transparent)]
22    Crypto(#[from] bitwarden_crypto::CryptoError),
23}
24
25#[allow(missing_docs)]
26#[derive(Debug, Error)]
27pub enum CollectionsParseError {
28    #[error(transparent)]
29    Crypto(#[from] bitwarden_crypto::CryptoError),
30    #[error(transparent)]
31    MissingField(#[from] bitwarden_core::MissingFieldError),
32}