Explanation
0003 — Typed, actionable errors
Status: Accepted (2026-10).
Context
A converter is only useful if a rejected spec tells the author exactly what is wrong and how to
fix it. String errors and Box<dyn Error> lose the field path and the cause chain, and they can't
be mapped to a stable exit code.
Decision
- Each library crate has one
thiserrorenum with apub type Result<T>alias; variants carry their#[source]cause, so the chain is never lost. NoanyhoworStringerrors in libraries (anyhowonly in binaries andxtask). - A spec problem carries a code (
unknown-field,removed-field,missing-field,invalid-value,conflict,unknown-reference,sensitive-value,refused), the field path as written, the line and column, the reason and a fix. The CLI prints✗ error[<code>] <path> (isoloom.yml:<line>:<column>), the reason, thenfix: …;--jsongives{ code, path, line, column, reason, fix }. - Exit codes are stable:
0the answer is yes;1the answer is no (the spec has problems, files drift, a target refuses the spec, a check failed);2the command couldn't do its job (a file it can't read, a name it doesn't know, a tool missing, a usage error). - No
unwrap,expectorpanicoutside tests; an impossible state is an#[expect(…, reason)]or, better, a type that can't represent it.
Consequences
- An old-format spec fails with a problem that names the removed field and its new form, rather than a vague parse error.
- Tools can branch on the exit code and the JSON problem list.
- The restriction lints (
unwrap_used,expect_used,panic, …) are at deny, so the rule is enforced, not just intended.