Skip to content

rust-sdk: a failed task records a null traceback, not an empty one #930

Description

@kartikeya-27

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2OpportunisticbugSomething isn't workingrust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions