mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 09:15:15 +08:00
chore: establish development baseline
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
//! CAS Engine 错误类型定义
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
/// CAS Engine 错误类型
|
||||
#[derive(Error, Debug)]
|
||||
pub enum CasError {
|
||||
/// IO 错误
|
||||
#[error("IO error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
/// Hash 不匹配
|
||||
#[error("Hash mismatch: expected {expected}, got {actual}")]
|
||||
HashMismatch {
|
||||
/// 期望的 Hash
|
||||
expected: String,
|
||||
/// 实际的 Hash
|
||||
actual: String,
|
||||
},
|
||||
|
||||
/// 对象不存在
|
||||
#[error("Object not found: {0}")]
|
||||
ObjectNotFound(String),
|
||||
|
||||
/// 数据库错误
|
||||
#[error("Database error: {0}")]
|
||||
Database(String),
|
||||
|
||||
/// 其他错误
|
||||
#[error(transparent)]
|
||||
Other(#[from] anyhow::Error),
|
||||
}
|
||||
|
||||
/// CAS Engine Result 类型
|
||||
pub type Result<T> = std::result::Result<T, CasError>;
|
||||
Reference in New Issue
Block a user