Skip to main content

UvsReason

Enum UvsReason 

Source
pub enum UvsReason {
Show 13 variants ValidationError, BusinessError, RunRuleError, NotFoundError, PermissionError, DataError, SystemError, NetworkError, ResourceError, TimeoutError, ConfigError(ConfErrReason), ExternalError, LogicError,
}
Expand description

Universal error reason classification with clear hierarchical structure 统一错误原因分类 - 采用清晰的分层结构

§Error Code Ranges

  • 100-199: Business Layer Errors (业务层错误)
  • 200-299: Infrastructure Layer Errors (基础设施层错误)
  • 300-399: Configuration & External Layer Errors (配置和外部层错误)

Variants§

§

ValidationError

Input validation errors (格式错误、参数校验失败等)

§

BusinessError

Business logic rule violations (业务规则违反、状态冲突等)

§

RunRuleError

Business logic rule violations (业务规则违反、状态冲突等)

§

NotFoundError

Resource not found (查询的资源不存在)

§

PermissionError

Permission and authorization errors (权限不足、认证失败)

§

DataError

Database and data processing errors (数据库操作、数据格式错误)

§

SystemError

File system and OS-level errors (文件系统、操作系统错误)

§

NetworkError

Network connectivity and protocol errors (网络连接、HTTP请求错误)

§

ResourceError

Resource exhaustion (内存不足、磁盘空间不足等)

§

TimeoutError

Operation timeouts (操作超时)

§

ConfigError(ConfErrReason)

Configuration-related errors (配置相关错误)

§

ExternalError

Third-party service errors (第三方服务错误)

§

LogicError

Third-party service errors (第三方服务错误)

Implementations§

Source§

impl UvsReason

Source

pub fn core_conf() -> Self

Source

pub fn feature_conf() -> Self

Source

pub fn dynamic_conf() -> Self

Source

pub fn validation_error() -> Self

Source

pub fn business_error() -> Self

Source

pub fn rule_error() -> Self

Source

pub fn not_found_error() -> Self

Source

pub fn permission_error() -> Self

Source

pub fn data_error() -> Self

Source

pub fn system_error() -> Self

Source

pub fn network_error() -> Self

Source

pub fn resource_error() -> Self

Source

pub fn timeout_error() -> Self

Source

pub fn external_error() -> Self

Source

pub fn logic_error() -> Self

Source§

impl UvsReason

Source

pub fn is_retryable(&self) -> bool

Check if this error is retryable 检查错误是否可重试

Source

pub fn is_high_severity(&self) -> bool

Check if this error should be logged with high severity 检查错误是否需要高优先级记录

Source

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

Get error category name for monitoring and metrics 获取错误类别名称用于监控和指标

Trait Implementations§

Source§

impl Clone for UvsReason

Source§

fn clone(&self) -> UvsReason

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 UvsReason

Source§

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

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

impl Display for UvsReason

Source§

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

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

impl Error for UvsReason

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl ErrorCode for UvsReason

Source§

fn error_code(&self) -> i32

Source§

impl ErrorIdentityProvider for UvsReason

Source§

impl PartialEq for UvsReason

Source§

fn eq(&self, other: &UvsReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl DomainReason for UvsReason

Source§

impl StructuralPartialEq for UvsReason

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<E> IntoSourcePayload for E
where E: Error + Send + Sync + 'static,

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<R> ToStructError<R> for R
where R: DomainReason,

Source§

fn to_err(self) -> StructError<R>

Source§

fn err_result<T>(self) -> Result<T, StructError<R>>

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> UvsFrom for T
where T: From<UvsReason>,

Source§

fn from_conf() -> Self

Source§

fn from_conf_reason(reason: ConfErrReason) -> Self

Source§

fn from_data() -> Self

Source§

fn from_sys() -> Self

Source§

fn from_biz() -> Self

Source§

fn from_logic() -> Self

Source§

fn from_rule() -> Self

Source§

fn from_res() -> Self

Source§

fn from_net() -> Self

Source§

fn from_timeout() -> Self

Source§

fn from_validation() -> Self

Source§

fn from_not_found() -> Self

Source§

fn from_permission() -> Self

Source§

fn from_external() -> Self