Skip to main content

WaeErrorKind

Enum WaeErrorKind 

Source
pub enum WaeErrorKind {
Show 107 variants InvalidFormat { field: String, expected: String, }, OutOfRange { field: String, min: Option<String>, max: Option<String>, }, Required { field: String, }, AlreadyExists { field: String, value: String, }, NotAllowed { field: String, allowed: Vec<String>, }, InvalidParams { param: String, reason: String, }, InvalidCredentials, AccountLocked, UserNotFound { identifier: String, }, UserAlreadyExists { username: String, }, InvalidToken { reason: String, }, TokenExpired, TokenNotValidYet, InvalidSignature, InvalidAlgorithm, MissingClaim { claim: String, }, InvalidClaim { claim: String, }, InvalidIssuer { expected: String, actual: String, }, InvalidAudience, KeyError, EncodingError, DecodingError, InvalidAuthorizationCode, InvalidRedirectUri, InvalidClientId, InvalidClientSecret, InvalidScope { scope: String, }, InvalidAccessToken, InvalidRefreshToken, AccessDenied { reason: String, }, UnsupportedGrantType { grant_type: String, }, UnsupportedResponseType { response_type: String, }, StateMismatch, OAuth2ProviderError { message: String, }, InvalidSamlRequest { reason: String, }, InvalidSamlResponse { reason: String, }, InvalidAssertion { reason: String, }, SignatureVerificationFailed { reason: String, }, MissingSignature, CertificateError { reason: String, }, XmlParsingError { reason: String, }, Base64DecodeError { reason: String, }, CompressionError { reason: String, }, AssertionExpired, AssertionNotYetValid, SamlAudienceValidationFailed { expected: String, actual: String, }, SamlIssuerValidationFailed { expected: String, actual: String, }, DestinationValidationFailed, ReplayAttackDetected, UnsupportedBinding { binding: String, }, UnsupportedNameIdFormat { format: String, }, InvalidSecret { reason: String, }, InvalidCode, CodeExpired, InvalidCodeFormat { expected: usize, actual: usize, }, InvalidTimeStep, Base32Error { reason: String, }, HmacError { reason: String, }, QrCodeError { reason: String, }, PermissionDenied { action: String, }, Forbidden { resource: String, }, ResourceNotFound { resource_type: String, identifier: String, }, ResourceConflict { resource: String, reason: String, }, ConnectionFailed { target: String, }, DnsResolutionFailed { host: String, }, TlsError { reason: String, }, ProtocolError { protocol: String, reason: String, }, ServiceUnavailable { service: String, }, GatewayError { gateway: String, }, StorageReadFailed { path: String, }, StorageWriteFailed { path: String, }, StorageDeleteFailed { path: String, }, InsufficientCapacity { required: u64, available: u64, }, DataCorruption { location: String, }, StorageFileNotFound { path: String, }, DatabaseConnectionFailed { reason: String, }, QueryFailed { query: Option<String>, reason: String, }, ExecuteFailed { statement: Option<String>, reason: String, }, TransactionFailed { reason: String, }, MigrationFailed { version: Option<String>, reason: String, }, CacheConnectionFailed { reason: String, }, CacheKeyNotFound { key: String, }, SerializationFailed { type_name: String, }, DeserializationFailed { type_name: String, }, CircuitBreakerOpen { service: String, }, RateLimitExceeded { limit: u64, }, MaxRetriesExceeded { attempts: u32, }, BulkheadFull { max_concurrent: usize, }, BulkheadWaitTimeout, TaskNotFound { task_id: String, }, TaskAlreadyExists { task_id: String, }, InvalidCronExpression { expression: String, }, TaskExecutionFailed { task_id: String, reason: String, }, SchedulerShutdown, MockError { reason: String, }, AssertionFailed { message: String, }, FixtureError { reason: String, }, EnvironmentError { reason: String, }, OperationTimeout { operation: String, timeout_ms: u64, }, ConfigMissing { key: String, }, ConfigInvalid { key: String, reason: String, }, InternalError { reason: String, }, NotImplemented { feature: String, }, IoError { operation: String, reason: String, }, JsonError { reason: String, }, ParseError { type_name: String, reason: String, }, RequestError { url: String, reason: String, },
}
Expand description

统一错误类型枚举

整合所有模块的错误变体,每个变体对应一个 i18n key。

Variants§

§

InvalidFormat

无效格式

Fields

§field: String

字段名

§expected: String

期望格式

§

OutOfRange

值超出范围

Fields

§field: String

字段名

§min: Option<String>

最小值

§max: Option<String>

最大值

§

Required

必填字段缺失

Fields

§field: String

字段名

§

AlreadyExists

值已存在

Fields

§field: String

字段名

§value: String

§

NotAllowed

值不允许

Fields

§field: String

字段名

§allowed: Vec<String>

允许的值

§

InvalidParams

无效参数

Fields

§param: String

参数名

§reason: String

原因

§

InvalidCredentials

无效凭证

§

AccountLocked

账户已锁定

§

UserNotFound

用户未找到

Fields

§identifier: String

用户标识

§

UserAlreadyExists

用户已存在

Fields

§username: String

用户名

§

InvalidToken

无效令牌

Fields

§reason: String

原因

§

TokenExpired

令牌已过期

§

TokenNotValidYet

令牌尚未生效

§

InvalidSignature

无效签名

§

InvalidAlgorithm

无效算法

§

MissingClaim

缺少声明

Fields

§claim: String

声明名

§

InvalidClaim

无效声明

Fields

§claim: String

声明名

§

InvalidIssuer

无效签发者

Fields

§expected: String

期望值

§actual: String

实际值

§

InvalidAudience

无效受众

§

KeyError

密钥错误

§

EncodingError

编码错误

§

DecodingError

解码错误

§

InvalidAuthorizationCode

无效授权码

§

InvalidRedirectUri

无效重定向 URI

§

InvalidClientId

无效客户端 ID

§

InvalidClientSecret

无效客户端密钥

§

InvalidScope

无效授权范围

Fields

§scope: String

范围

§

InvalidAccessToken

无效访问令牌

§

InvalidRefreshToken

无效刷新令牌

§

AccessDenied

访问被拒绝

Fields

§reason: String

原因

§

UnsupportedGrantType

不支持的授权类型

Fields

§grant_type: String

类型

§

UnsupportedResponseType

不支持的响应类型

Fields

§response_type: String

类型

§

StateMismatch

状态不匹配

§

OAuth2ProviderError

OAuth2 提供者错误

Fields

§message: String

错误信息

§

InvalidSamlRequest

无效 SAML 请求

Fields

§reason: String

原因

§

InvalidSamlResponse

无效 SAML 响应

Fields

§reason: String

原因

§

InvalidAssertion

无效断言

Fields

§reason: String

原因

§

SignatureVerificationFailed

签名验证失败

Fields

§reason: String

原因

§

MissingSignature

缺少签名

§

CertificateError

证书错误

Fields

§reason: String

原因

§

XmlParsingError

XML 解析错误

Fields

§reason: String

原因

§

Base64DecodeError

Base64 解码错误

Fields

§reason: String

原因

§

CompressionError

压缩错误

Fields

§reason: String

原因

§

AssertionExpired

断言已过期

§

AssertionNotYetValid

断言尚未生效

§

SamlAudienceValidationFailed

受众验证失败

Fields

§expected: String

期望值

§actual: String

实际值

§

SamlIssuerValidationFailed

发行人验证失败

Fields

§expected: String

期望值

§actual: String

实际值

§

DestinationValidationFailed

目标验证失败

§

ReplayAttackDetected

重放攻击检测

§

UnsupportedBinding

不支持的绑定

Fields

§binding: String

绑定类型

§

UnsupportedNameIdFormat

不支持的名称 ID 格式

Fields

§format: String

格式

§

InvalidSecret

无效密钥

Fields

§reason: String

原因

§

InvalidCode

无体验证码

§

CodeExpired

验证码已过期

§

InvalidCodeFormat

验证码格式错误

Fields

§expected: usize

期望位数

§actual: usize

实际位数

§

InvalidTimeStep

无效时间步长

§

Base32Error

Base32 错误

Fields

§reason: String

原因

§

HmacError

HMAC 错误

Fields

§reason: String

原因

§

QrCodeError

QR 码错误

Fields

§reason: String

原因

§

PermissionDenied

权限拒绝

Fields

§action: String

操作

§

Forbidden

禁止访问

Fields

§resource: String

资源

§

ResourceNotFound

资源未找到

Fields

§resource_type: String

资源类型

§identifier: String

资源标识

§

ResourceConflict

资源冲突

Fields

§resource: String

资源

§reason: String

原因

§

ConnectionFailed

连接失败

Fields

§target: String

目标

§

DnsResolutionFailed

DNS 解析失败

Fields

§host: String

主机

§

TlsError

TLS 错误

Fields

§reason: String

原因

§

ProtocolError

协议错误

Fields

§protocol: String

协议

§reason: String

原因

§

ServiceUnavailable

服务不可用

Fields

§service: String

服务名

§

GatewayError

网关错误

Fields

§gateway: String

网关

§

StorageReadFailed

读取失败

Fields

§path: String

路径

§

StorageWriteFailed

写入失败

Fields

§path: String

路径

§

StorageDeleteFailed

删除失败

Fields

§path: String

路径

§

InsufficientCapacity

容量不足

Fields

§required: u64

需要

§available: u64

可用

§

DataCorruption

数据损坏

Fields

§location: String

位置

§

StorageFileNotFound

文件未找到

Fields

§path: String

路径

§

DatabaseConnectionFailed

数据库连接失败

Fields

§reason: String

原因

§

QueryFailed

查询失败

Fields

§query: Option<String>

查询语句

§reason: String

原因

§

ExecuteFailed

执行失败

Fields

§statement: Option<String>

语句

§reason: String

原因

§

TransactionFailed

事务失败

Fields

§reason: String

原因

§

MigrationFailed

迁移失败

Fields

§version: Option<String>

版本

§reason: String

原因

§

CacheConnectionFailed

缓存连接失败

Fields

§reason: String

原因

§

CacheKeyNotFound

缓存键不存在

Fields

§key: String

§

SerializationFailed

序列化失败

Fields

§type_name: String

类型

§

DeserializationFailed

反序列化失败

Fields

§type_name: String

类型

§

CircuitBreakerOpen

熔断器开启

Fields

§service: String

服务名

§

RateLimitExceeded

限流超出

Fields

§limit: u64

限制

§

MaxRetriesExceeded

重试次数耗尽

Fields

§attempts: u32

次数

§

BulkheadFull

舱壁已满

Fields

§max_concurrent: usize

最大并发

§

BulkheadWaitTimeout

舱壁等待超时

§

TaskNotFound

任务未找到

Fields

§task_id: String

任务 ID

§

TaskAlreadyExists

任务已存在

Fields

§task_id: String

任务 ID

§

InvalidCronExpression

无效 Cron 表达式

Fields

§expression: String

表达式

§

TaskExecutionFailed

任务执行失败

Fields

§task_id: String

任务 ID

§reason: String

原因

§

SchedulerShutdown

调度器已关闭

§

MockError

Mock 错误

Fields

§reason: String

原因

§

AssertionFailed

断言失败

Fields

§message: String

消息

§

FixtureError

Fixture 错误

Fields

§reason: String

原因

§

EnvironmentError

环境错误

Fields

§reason: String

原因

§

OperationTimeout

操作超时

Fields

§operation: String

操作名

§timeout_ms: u64

超时时间(毫秒)

§

ConfigMissing

配置缺失

Fields

§key: String

配置键

§

ConfigInvalid

配置无效

Fields

§key: String

配置键

§reason: String

原因

§

InternalError

内部错误

Fields

§reason: String

原因

§

NotImplemented

未实现

Fields

§feature: String

功能

§

IoError

IO 错误

Fields

§operation: String

操作

§reason: String

原因

§

JsonError

JSON 错误

Fields

§reason: String

原因

§

ParseError

解析错误

Fields

§type_name: String

类型

§reason: String

原因

§

RequestError

请求错误

Fields

§url: String

URL

§reason: String

原因

Implementations§

Source§

impl WaeErrorKind

Source

pub fn category(&self) -> ErrorCategory

获取错误分类

Source

pub fn i18n_key(&self) -> &'static str

获取国际化键

Source

pub fn i18n_data(&self) -> Value

获取国际化数据

Trait Implementations§

Source§

impl Clone for WaeErrorKind

Source§

fn clone(&self) -> WaeErrorKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WaeErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WaeErrorKind

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<WaeErrorKind, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for WaeErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Serialize for WaeErrorKind

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,