#[non_exhaustive]pub enum CoreError {
Io(Error),
Serialization(Error),
App(String),
Path(PathError),
Platform(String),
Cli(Box<PlatformCliError>),
}Expand description
Application error type.
Library functions return this error type. Use thiserror for
derive macros and proper error context.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
An I/O operation failed.
Serialization(Error)
A serialization or deserialization failure.
App(String)
An application-level error for cases that don’t warrant a dedicated variant. This variant carries no stability guarantee and should not be matched on programmatically.
Path(PathError)
A path traversal or path validation failure.
Platform(String)
A platform operation error (CLI execution failure, parse error, auth failure, etc.).
Cli(Box<PlatformCliError>)
底层平台 CLI 执行错误(结构化)。
包含中文用户消息和修复建议,原始 stderr 仅用于调试。
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Box<PlatformCliError>> for CoreError
impl From<Box<PlatformCliError>> for CoreError
Source§fn from(source: Box<PlatformCliError>) -> Self
fn from(source: Box<PlatformCliError>) -> Self
Source§impl From<PlatformCliError> for CoreError
Ergonomic conversion from PlatformCliError into CoreError::Cli.
impl From<PlatformCliError> for CoreError
Ergonomic conversion from PlatformCliError into CoreError::Cli.
thiserror’s #[from] on Box<T> generates From<Box<T>>; this manual
impl lets callers write Err(platform_err.into()) without explicitly boxing.
Source§fn from(err: PlatformCliError) -> Self
fn from(err: PlatformCliError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CoreError
impl !UnwindSafe for CoreError
impl Forget for CoreError
impl Freeze for CoreError
impl Move for CoreError
impl Send for CoreError
impl Sync for CoreError
impl Unpin for CoreError
impl UnsafeUnpin for CoreError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more