Skip to main content

oxirs_cluster/storage/
error.rs

1//! Storage error types
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum StorageError {
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9
10    #[error("Serialization error: {0}")]
11    Serialization(#[from] serde_json::Error),
12
13    #[error("Corruption detected in {file}: {message}")]
14    Corruption { file: String, message: String },
15
16    #[error("Snapshot not found")]
17    SnapshotNotFound,
18
19    #[error("Log entry not found at index {index}")]
20    LogEntryNotFound { index: u64 },
21
22    #[error("Invalid log range: {start} to {end}")]
23    InvalidRange { start: u64, end: u64 },
24}