1#[cfg(feature = "archive")]
2use std::path::PathBuf;
3use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum Error {
8 #[error("no audit trail providers configured")]
11 AuditProvidersNotConfigured,
12
13 #[cfg(feature = "archive")]
16 #[error("not a valid backup archive '{0}' (no manifest)")]
17 NotValidBackupArchive(PathBuf),
18
19 #[cfg(feature = "archive")]
22 #[error("backup archive '{0}' (version {1}) is not compatible with {2} backend (backup archive needs upgrading)")]
23 BackupArchiveUpgradeRequired(PathBuf, u8, String),
24
25 #[cfg(feature = "archive")]
28 #[error("backup archive '{0}' (version {1}) is not compatible with {2} backend (accounts need upgrading)")]
29 IncompatibleBackupArchive(PathBuf, u8, String),
30
31 #[error(transparent)]
33 TryFromSlice(#[from] std::array::TryFromSliceError),
34
35 #[error(transparent)]
37 Core(#[from] sos_core::Error),
38
39 #[error(transparent)]
41 Database(#[from] sos_database::Error),
42
43 #[error(transparent)]
45 FileSystem(#[from] sos_filesystem::Error),
46
47 #[cfg(feature = "archive")]
49 #[error(transparent)]
50 ZipArchive(#[from] sos_archive::Error),
51
52 #[cfg(feature = "archive")]
54 #[error(transparent)]
55 DatabaseArchive(#[from] sos_database::archive::Error),
56
57 #[cfg(feature = "archive")]
59 #[error(transparent)]
60 FileSystemArchive(#[from] sos_filesystem::archive::Error),
61
62 #[error(transparent)]
64 Vault(#[from] sos_vault::Error),
65
66 #[error(transparent)]
68 Io(#[from] std::io::Error),
69
70 #[cfg(feature = "preferences")]
71 #[error(transparent)]
73 Preferences(#[from] sos_preferences::Error),
74
75 #[cfg(feature = "system-messages")]
76 #[error(transparent)]
78 SystemMessages(#[from] sos_system_messages::Error),
79}
80
81pub use sos_core::StorageError;