Skip to main content

office_rs/error/format/
xlsx.rs

1use thiserror::Error;
2
3/// Excel特定错误
4#[derive(Error, Debug)]
5pub enum XlsxError {
6    #[error("工作表不存在: {name}")] WorksheetNotFound {
7        name: String,
8    },
9
10    #[error("单元格引用无效: {reference}")] InvalidCellReference {
11        reference: String,
12    },
13
14    #[error("公式语法错误: {formula}")] InvalidFormula {
15        formula: String,
16    },
17
18    #[error("样式ID无效: {style_id}")] InvalidStyleId {
19        style_id: String,
20    },
21
22    #[error("共享字符串索引超出范围: {index}")] SharedStringIndexOutOfRange {
23        index: usize,
24    },
25
26    #[error("工作表创建失败: {name}")] WorksheetCreationFailed {
27        name: String,
28    },
29}