agent_proxy_rust_storage/error.rs
1use thiserror::Error;
2
3/// Storage error type covering all backend failure modes.
4#[derive(Debug, Clone, Error)]
5pub enum StorageError {
6 /// A generic backend operation failed.
7 #[error("backend error: {0}")]
8 Backend(String),
9
10 /// The requested resource was not found.
11 #[error("not found: {0}")]
12 NotFound(String),
13
14 /// A unique constraint or primary key conflict occurred.
15 #[error("duplicate: {0}")]
16 Duplicate(String),
17
18 /// Failed to connect to the storage backend.
19 #[error("connection error: {0}")]
20 Connection(String),
21
22 /// Schema migration failed.
23 #[error("migration error: {0}")]
24 Migration(String),
25}