office_rs/error/format/file.rs
1use thiserror::Error;
2
3/// 文件相关错误
4#[derive(Error, Debug)]
5pub enum FileError {
6 #[error("文件不存在: {path}")] NotFound {
7 path: String,
8 },
9
10 #[error("文件权限不足: {path}")] PermissionDenied {
11 path: String,
12 },
13
14 #[error("文件已损坏: {path}")] Corrupted {
15 path: String,
16 },
17
18 #[error("文件格式不正确: {path}")] InvalidFormat {
19 path: String,
20 },
21}