Skip to main content

bitwarden_importers/
error.rs

1use bitwarden_error::bitwarden_error;
2use thiserror::Error;
3
4#[allow(missing_docs)]
5#[bitwarden_error(flat)]
6#[derive(Error, Debug)]
7pub enum ImportError {
8    #[error("The file is not a valid KeePass database (.kdbx)")]
9    KdbxInvalidFormat,
10    #[error("The KeePass database exceeds the maximum supported size")]
11    KdbxFileTooLarge,
12    #[error("Incorrect KeePass password or key file")]
13    KdbxWrongCredentials,
14    #[error("The KeePass database could not be read; it may be corrupted or unsupported")]
15    KdbxCorruptOrUnsupported,
16
17    #[error(transparent)]
18    NotAuthenticated(#[from] bitwarden_core::NotAuthenticatedError),
19    #[error(transparent)]
20    Api(#[from] bitwarden_core::ApiError),
21    #[error(transparent)]
22    BitwardenCrypto(#[from] bitwarden_crypto::CryptoError),
23    /// Encryption from the shared import bridge (`bitwarden_exporters::encrypt_import`).
24    #[error(transparent)]
25    Export(#[from] bitwarden_exporters::ExportError),
26}