pub enum CliCoreError {
MissingAuthProvider(String),
AuthProvider {
provider: String,
source: Box<dyn Error + Send + Sync>,
},
InvalidOutputFormat(String),
Message(String),
SystemMessage {
message: String,
system: String,
code: String,
request_id: String,
},
System {
system: String,
source: Box<dyn Error + Send + Sync>,
},
Detailed {
code: String,
system: String,
request_id: String,
source: Box<dyn Error + Send + Sync>,
},
ExitCode {
code: i32,
source: Box<dyn Error + Send + Sync>,
},
Io(Error),
Json(Error),
Transport(Error),
}Expand description
Framework error type.
Variants§
MissingAuthProvider(String)
Requested auth provider has not been registered.
AuthProvider
Auth provider failed.
InvalidOutputFormat(String)
Output format is not supported.
Message(String)
Plain message error.
SystemMessage
Structured message with explicit envelope metadata.
Fields
System
Wrapped source error with backend/system attribution.
Detailed
Wrapped source error with structured metadata captured up front.
Fields
ExitCode
Wrapped source error with explicit process exit code.
Io(Error)
IO error.
Json(Error)
JSON serialization or decoding error.
Transport(Error)
Structured HTTP transport error.
Implementations§
Source§impl CliCoreError
impl CliCoreError
Sourcepub fn message_for_system(
system: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn message_for_system( system: impl Into<String>, message: impl Into<String>, ) -> Self
Creates a structured message attributed to a backend/system id.
Sourcepub fn with_system(
system: impl Into<String>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn with_system( system: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
Wraps a source error with backend/system attribution.
Sourcepub fn with_exit_code(
code: i32,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn with_exit_code( code: i32, source: impl Error + Send + Sync + 'static, ) -> Self
Wraps a source error with an explicit process exit code.
Sourcepub fn with_detailed_error(
source: impl DetailedError + Send + Sync + 'static,
) -> Self
pub fn with_detailed_error( source: impl DetailedError + Send + Sync + 'static, ) -> Self
Captures structured metadata from a detailed source error.
Sourcepub fn is_auth(&self) -> bool
pub fn is_auth(&self) -> bool
Reports whether this error originates from credential resolution.
True for MissingAuthProvider and
AuthProvider. The engine uses this to classify a
command outcome as auth-error rather than a generic command error, based
on the error a handler actually returns — so a handler that swallows a
resolution failure and then fails for another reason is not misclassified.
Trait Implementations§
Source§impl Debug for CliCoreError
impl Debug for CliCoreError
Source§impl Display for CliCoreError
impl Display for CliCoreError
Source§impl Error for CliCoreError
impl Error for CliCoreError
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()