sos_backend/
error.rs

1use thiserror::Error;
2
3/// Errors generated by the library.
4#[derive(Debug, Error)]
5pub enum Error {
6    /// Error generated when attempting to append audit
7    /// events without any providers configured.
8    #[error("no audit trail providers configured")]
9    AuditProvidersNotConfigured,
10
11    /// Error generated converting to fixed length slice.
12    #[error(transparent)]
13    TryFromSlice(#[from] std::array::TryFromSliceError),
14
15    /// Errors generated by the core library.
16    #[error(transparent)]
17    Core(#[from] sos_core::Error),
18
19    /// Errors generated by the database library.
20    #[error(transparent)]
21    Database(#[from] sos_database::Error),
22
23    /// Errors generated by the filesystem library.
24    #[error(transparent)]
25    FileSystem(#[from] sos_filesystem::Error),
26
27    /// Errors generated by the vault library.
28    #[error(transparent)]
29    Vault(#[from] sos_vault::Error),
30
31    /// Errors generated by the IO module.
32    #[error(transparent)]
33    Io(#[from] std::io::Error),
34
35    #[cfg(feature = "preferences")]
36    /// Errors generated by the preferences library.
37    #[error(transparent)]
38    Preferences(#[from] sos_preferences::Error),
39
40    #[cfg(feature = "system-messages")]
41    /// Errors generated by the system messages library.
42    #[error(transparent)]
43    SystemMessages(#[from] sos_system_messages::Error),
44}
45
46// Backwards compatible
47pub use sos_core::StorageError;