pub enum VtxError {
DatabaseError(String),
SerializationError(String),
AuthDenied(u16),
PermissionDenied(String),
NotFound(String),
Internal(String),
}Expand description
插件运行时错误类型(统一错误模型)
定义插件在运行过程中可能出现的所有已知错误。 所有错误均支持序列化,可用于 HTTP 返回或日志透传。
Variants§
DatabaseError(String)
底层数据库错误(如 SQL 执行失败、约束冲突等)
SerializationError(String)
序列化或反序列化失败(如 JSON 格式不匹配)
AuthDenied(u16)
身份验证失败(带建议返回的 HTTP 状态码,如 401 / 403)
PermissionDenied(String)
权限不足(如在只读环境尝试执行写操作)
NotFound(String)
资源不存在(如文件、视频、用户未找到等)
Internal(String)
插件内部逻辑错误(兜底类型)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VtxError
impl<'de> Deserialize<'de> for VtxError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Error for VtxError
impl Error for VtxError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for VtxError
impl RefUnwindSafe for VtxError
impl Send for VtxError
impl Sync for VtxError
impl Unpin for VtxError
impl UnwindSafe for VtxError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more