#[non_exhaustive]pub struct Error {
pub code: ErrorCode,
pub message: String,
pub operation: Option<String>,
pub native_code: Option<String>,
pub remediation: Option<String>,
pub details: Option<Box<Value>>,
}Expand description
An error returned by SDK operations such as spawn.
operation, native_code, and remediation are top-level fields also
exposed by Node, .NET, and mxc_ffi. Backend-specific details are
preserved in Rust errors, executor JSON error envelopes, and the C error
structure; Node and .NET expose them as details and Details.
This type is #[non_exhaustive]. Use Error::new rather than a struct
literal so future versions can add fields without breaking construction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: ErrorCodeThe SDK error code.
message: StringA human-readable message.
operation: Option<String>The API call that failed, namespaced by its interface and free of call parameters, so it can be grouped in telemetry. Absent when the failure was raised before any API call.
native_code: Option<String>The underlying platform status, e.g. 0x80070490. Absent when the
failure carries none.
remediation: Option<String>An actionable “how to fix it” hint, when the failure carries one.
details: Option<Box<Value>>Backend-specific structured context. May contain sensitive recovery identifiers; inspect it explicitly rather than logging it wholesale.
Implementations§
Trait Implementations§
Source§impl Display for Error
Renders code: message, then the failing call and its status in brackets
when present — so a consumer that only logs the error does not silently lose
the diagnosis. Mirrors the internal type’s rendering.
impl Display for Error
Renders code: message, then the failing call and its status in brackets
when present — so a consumer that only logs the error does not silently lose
the diagnosis. Mirrors the internal type’s rendering.
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()