platform/error/storage_error.rs
1//! 存储相关错误类型
2//!
3//! 定义所有与文件系统、存储后端相关的错误
4
5use thiserror::Error;
6
7/// 存储相关错误
8#[derive(Error, Debug)]
9pub enum StorageError {
10 #[error("File not found: {path}")]
11 FileNotFound { path: String },
12
13 #[error("Permission denied: {path}")]
14 PermissionDenied { path: String },
15
16 #[error("Disk full: {path}")]
17 DiskFull { path: String },
18
19 #[error("Corruption detected: {path}")]
20 Corruption { path: String },
21
22 #[error("Storage backend error: {backend}")]
23 Backend { backend: String },
24}