Expand description
CoreError:基于 thiserror 的企业级错误处理
目标:展示单一映射来源(ErrorCode),简化字段、统一严重度/可重试策略, 并保留可序列化的 ErrorRecord 供观测与分析使用。
Structs§
- ApiError
- API 错误
- Error
Builder - 统一的错误构建器,避免直接依赖枚举内部字段
- Error
Record - 统一的可观测记录
- Network
Error - 网络错误
- Retry
Policy - 重试策略(供 CoreError 使用)
Enums§
- Builder
Kind - 枚举化的构建器目标类型
- Core
Error - 轻量版核心错误
- Recovery
Strategy - 恢复策略
Functions§
- api_
error - 创建API错误
- authentication_
error - 创建认证错误
- business_
error - 创建业务错误
- configuration_
error - 创建配置错误
- network_
error - 创建网络错误
- network_
error_ with_ details - 创建带详细信息的网络错误
- permission_
missing_ error - 创建权限缺失错误
- rate_
limit_ error - 创建限流错误
- serialization_
error - 创建序列化错误
- service_
unavailable_ error - 创建服务不可用错误
- sso_
token_ invalid_ error - 创建SSO令牌无效错误
- timeout_
error - 创建超时错误
- token_
expired_ error - 创建访问令牌过期错误
- token_
invalid_ error - 创建访问令牌无效错误
- user_
identity_ invalid_ error - 创建用户身份无效错误
- validation_
error - 创建验证错误