bitwarden_importers/
error.rs1use 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("The 1Password email address is not valid")]
18 OnePasswordInvalidEmail,
19 #[error("The 1Password sign-in address is not valid")]
20 OnePasswordInvalidSignInAddress,
21 #[error("The 1Password Secret Key is not valid")]
22 OnePasswordInvalidSecretKey,
23 #[error("Incorrect 1Password email, password, or Secret Key")]
24 OnePasswordBadCredentials,
25 #[error("The 1Password account requires a two-factor code")]
26 OnePasswordTwoFactorRequired,
27 #[error("The 1Password two-factor code was rejected or not entered")]
28 OnePasswordTwoFactorFailed,
29 #[error("The 1Password sign-in was canceled")]
30 OnePasswordCanceled,
31 #[error("The new 1Password device was denied on another device")]
32 OnePasswordDenied,
33 #[error("The 1Password verification code was wrong too many times")]
34 OnePasswordVerificationCodeFailed,
35 #[error("This 1Password account uses a sign-in method the importer does not support: {0}")]
36 OnePasswordUnsupported(String),
37 #[error("Could not reach 1Password: {0}")]
38 OnePasswordNetwork(String),
39 #[error("The 1Password import failed: {0}")]
40 OnePasswordInternal(String),
41 #[error("The data 1Password returned could not be read")]
42 OnePasswordDecryption,
43
44 #[error(transparent)]
45 NotAuthenticated(#[from] bitwarden_core::NotAuthenticatedError),
46 #[error(transparent)]
47 Api(#[from] bitwarden_core::ApiError),
48 #[error(transparent)]
49 BitwardenCrypto(#[from] bitwarden_crypto::CryptoError),
50 #[error(transparent)]
52 KeeperCrypto(#[from] crate::keeper::crypto::KeeperCryptoError),
53 #[error(transparent)]
55 Export(#[from] bitwarden_exporters::ExportError),
56}