pub struct ErrorEnvelope {
pub category: String,
pub code: String,
pub exit_code: i32,
pub message: String,
pub hint: Option<String>,
pub details: Option<Value>,
}Expand description
Stable error payload carried in Envelope::error.
Field naming is locked by the
machine-readable-output/error-handling specs.
Fields§
§category: StringStable snake_case category from the closed SubXError set or
the synthetic "argument_parsing" category for clap failures.
code: StringStable upper-snake-case machine code (e.g. E_AI_SERVICE).
exit_code: i32Process exit code returned alongside the envelope.
message: StringHuman-readable message (English; matches user_friendly_message).
hint: Option<String>Optional short remediation hint.
details: Option<Value>Optional structured details (partial results, etc.).
Implementations§
Source§impl ErrorEnvelope
impl ErrorEnvelope
Sourcepub fn from_error(err: &SubXError) -> Self
pub fn from_error(err: &SubXError) -> Self
Build an envelope from a SubXError.
Sourcepub fn argument_parsing(message: String, exit_code: i32) -> Self
pub fn argument_parsing(message: String, exit_code: i32) -> Self
Build the synthetic envelope used for clap argument-parsing
failures. The category argument_parsing is intentionally NOT
part of the closed SubXError-derived set.
Trait Implementations§
Source§impl Debug for ErrorEnvelope
impl Debug for ErrorEnvelope
Auto Trait Implementations§
impl Freeze for ErrorEnvelope
impl RefUnwindSafe for ErrorEnvelope
impl Send for ErrorEnvelope
impl Sync for ErrorEnvelope
impl Unpin for ErrorEnvelope
impl UnsafeUnpin for ErrorEnvelope
impl UnwindSafe for ErrorEnvelope
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