Skip to main content

chronix_engine/storage/
error.rs

1//! Storage backend error types.
2
3use std::path::PathBuf;
4
5use thiserror::Error;
6
7/// Storage backend errors.
8#[derive(Debug, Error)]
9pub enum StorageError {
10    /// Underlying I/O error.
11    #[error("Storage I/O error: {0}")]
12    Io(#[from] std::io::Error),
13
14    /// Segment not found at the expected path.
15    #[error("Segment not found: {path}")]
16    NotFound {
17        /// Filesystem path that was not found.
18        path: PathBuf,
19    },
20
21    /// Invalid segment path construction.
22    #[error("Invalid segment path: {detail}")]
23    InvalidPath {
24        /// Description of the path error.
25        detail: String,
26    },
27}
28
29/// A specialized `Result` type for storage operations.
30pub type Result<T> = std::result::Result<T, StorageError>;