office_rs/error/format/parse.rs
1use thiserror::Error;
2
3/// 解析相关错误
4#[derive(Error, Debug)]
5pub enum ParseError {
6 #[error("缺少必需元素: {element}")] MissingElement {
7 element: String,
8 },
9
10 #[error("无效的属性值: {attribute}={value}")] InvalidAttribute {
11 attribute: String,
12 value: String,
13 },
14
15 #[error("不支持的版本: {version}")] UnsupportedVersion {
16 version: String,
17 },
18
19 #[error("无效的命名空间: {namespace}")] InvalidNamespace {
20 namespace: String,
21 },
22}