Skip to main content

Module errors

Module errors 

Source
Expand description

The crate-wide WXF error type.

Error is the error type of ToWXF / FromWXF, so every serialization failure across the whole workspace funnels through it. It carries only Debug — no Display/std::error::Error impls — and does not serialize itself to a Wolfram Failure[…]. When a caller needs to surface a failure to the kernel, it builds one explicitly with expr! (e.g. the WXF export bridge wraps an arg-decode Error as Failure["ArgumentError", <|"Message" -> …|>]).

Design: structured data is carried only where it’s useful — an unexpected token reports the tokens it would have accepted and the one it got, a size mismatch reports both counts, a typed field error reports the path. Everything else — malformed headers, truncated varints, unknown bytes, bad UTF-8 — is a plain Invalid with a message. The Debug text carries this detail.

Enums§

Error
Errors returned by [to_wxf][crate::to_wxf] / [from_wxf][crate::from_wxf] and every ToWXF / FromWXF impl.