Skip to main content

egide_storage/
error.rs

1//! Storage error types.
2
3use thiserror::Error;
4
5/// Errors that can occur during storage operations.
6#[derive(Debug, Error)]
7pub enum StorageError {
8    /// Entry not found.
9    #[error("entry not found: {0}")]
10    NotFound(String),
11
12    /// Entry already exists.
13    #[error("entry already exists: {0}")]
14    AlreadyExists(String),
15
16    /// Connection failed.
17    #[error("connection failed: {0}")]
18    ConnectionFailed(String),
19
20    /// Query failed.
21    #[error("query failed: {0}")]
22    QueryFailed(String),
23
24    /// Invalid input.
25    #[error("invalid input: {0}")]
26    InvalidInput(String),
27
28    /// Serialization error.
29    #[error("serialization error: {0}")]
30    Serialization(String),
31
32    /// Transaction error.
33    #[error("transaction error: {0}")]
34    Transaction(String),
35
36    /// Generic I/O error.
37    #[error("io error: {0}")]
38    Io(String),
39}