You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 968a754
Browse filesBrowse the repository at this point in the historyBrowse files
feat(golang): every failure a guest reports is a Diagnostic that unwraps to its sentinel
A Go caller could check an error's kind with errors.Is and nothing more:
the guest handed back a status number, and errors.As had no type to
target. #1100 gave both guests se_last_error, which hands over the full
error behind a failed export. This reads it.
guest.Call fetches it after any non-zero status and returns a
*Diagnostic: Code, Message, Help, URL, Severity, Fields and Causes, with
Unwrap returning the sentinel the status already mapped to, so every
errors.Is check keeps working and Error() is the Rust message. The
buffer is wiped on both sides once read. A guest with no se_last_error,
nothing recorded, or bytes that do not decode into an error with a
message all give the bare sentinel, as before; a trap fetching it also
wraps ErrTrap, so the caller closes the instance as after any trap.
encrypt and auth expose the type as Diagnostic (and Cause) by alias, as
they do the sentinels. ExpectedKeyset and FoundKeyset read a
foreign-keyset refusal's two keysets, and Field and Reason a refused
plan, record or value's field and reason.
Tests: a hand-assembled guest drives each missing or broken detail and
checks the wipe; each ZeroKMS outcome, each engine refusal reachable
through the public API, and each profile-store kind asserts its code;
a guest with se_last_error unbound fails with the bare sentinel; the
foreign-keyset refusal carries both ids, hermetically and live. The
README's Errors section explains errors.Is for the kind and errors.As for
the detail, and the rule for what an error may contain.
Closes#1101
Claude-Session: https://claude.ai/code/session_01URtfKsTToFUCRwq3g7gCUf
0 commit comments