use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("IO错误: {0}")]
Io(#[from] std::io::Error),
#[error("序列化错误: {0}")]
Serialization(#[from] serde_json::Error),
#[error("验证错误: {0}")]
Validation(String),
#[error("认证错误: {0}")]
Authentication(String),
#[error("授权错误: {0}")]
Authorization(String),
#[error("业务错误: {0}")]
Business(String),
#[error("系统错误: {0}")]
System(String),
#[error("未知错误: {0}")]
Unknown(String),
}
pub type Result<T> = std::result::Result<T, Error>;