reflex/storage/nvme/
error.rs1use std::path::PathBuf;
2use thiserror::Error;
3
4use crate::storage::mmap::MmapError;
5
6#[derive(Error, Debug)]
7pub enum NvmeError {
9 #[error("I/O error: {0}")]
11 Io(#[from] std::io::Error),
12
13 #[error("mmap error: {0}")]
15 Mmap(#[from] MmapError),
16
17 #[error("serialization error: {0}")]
19 Serialization(String),
20
21 #[error("entry not found: tenant={tenant_id}, id={entry_id}")]
23 NotFound {
24 tenant_id: u64,
26 entry_id: u64,
28 },
29
30 #[error("storage path unavailable: {path}")]
32 StorageUnavailable {
33 path: PathBuf,
35 },
36
37 #[error("failed to create tenant directory: {path}")]
39 TenantDirCreationFailed {
40 path: PathBuf,
42 },
43}
44
45pub type NvmeResult<T> = Result<T, NvmeError>;