crates/flexiq/src/outcome.rs:42 writes:
serde_json::json!({
"errtype": "TaskError",
"message": err.message,
"traceback": serde_json::Value::Null,
})
BINDING_CONTRACT.md says the key is required and its type is an array of
strings, [] when the language or runtime cannot provide frames. null is a
third shape, and the Rust SDK is the only shell that writes it.
It is tolerated by most readers and not by all — see the companion issue against
the Go client, which reads it as unstructured and loses the errtype with it. A
reader that has to special-case a shape the contract does not describe is a
reader that will eventually not.
Fix is one literal, Value::Null to an empty array, plus the formatter test.
Worth checking whether the doc comment above it should change too: it explains
that errtype is the constant "TaskError" and traceback is null because
Rust has no exception type to name and no stack trace to attach. The first half
stays true; the second is an argument for [], which is exactly what the
contract says the no-frames case looks like.
crates/flexiq/src/outcome.rs:42writes:BINDING_CONTRACT.mdsays the key is required and its type is an array ofstrings,
[]when the language or runtime cannot provide frames.nullis athird shape, and the Rust SDK is the only shell that writes it.
It is tolerated by most readers and not by all — see the companion issue against
the Go client, which reads it as unstructured and loses the
errtypewith it. Areader that has to special-case a shape the contract does not describe is a
reader that will eventually not.
Fix is one literal,
Value::Nullto an empty array, plus the formatter test.Worth checking whether the doc comment above it should change too: it explains
that
errtypeis the constant"TaskError"andtracebackis null becauseRust has no exception type to name and no stack trace to attach. The first half
stays true; the second is an argument for
[], which is exactly what thecontract says the no-frames case looks like.