1use thiserror::Error;
16
17pub type AuditResult<T> = Result<T, AuditError>;
19
20#[derive(Error, Debug)]
22pub enum AuditError {
23 #[error("Configuration error: {0}")]
24 Configuration(String, #[source] Option<Box<dyn std::error::Error + Send + Sync>>),
25
26 #[error("config not loaded")]
27 ConfigNotLoaded,
28
29 #[error("Target error: {0}")]
30 Target(#[from] rustfs_targets::TargetError),
31
32 #[error("System not initialized: {0}")]
33 NotInitialized(String),
34
35 #[error("System already initialized")]
36 AlreadyInitialized,
37
38 #[error("Audit system is paused; entry was not accepted")]
39 Paused,
40
41 #[error("Storage not available: {0}")]
42 StorageNotAvailable(String),
43
44 #[error("Failed to save configuration: {0}")]
45 SaveConfig(#[source] Box<dyn std::error::Error + Send + Sync>),
46
47 #[error("Failed to load configuration: {0}")]
48 LoadConfig(#[source] Box<dyn std::error::Error + Send + Sync>),
49
50 #[error("Serialization error: {0}")]
51 Serialization(#[from] serde_json::Error),
52
53 #[error("I/O error: {0}")]
54 Io(#[from] std::io::Error),
55
56 #[error("Join error: {0}")]
57 Join(#[from] tokio::task::JoinError),
58}