mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
`meta.errorCode` is the mechanism this API chose for machine-readable errors, and the envelope's own description tells a client to branch on it rather than on the prose. Of the two hundred and forty-two codes in the tree, sixteen appeared anywhere in the contract. A client had to discover each one by triggering the error in testing, and had no way at all to learn that a new one had appeared. They are enumerated now, grouped by the surface that emits them, in the description of the field they belong to. The list is generated from the code and committed as a literal so it reads in a diff, and the sentence in the document is rendered from it rather than written beside it. Nothing is renamed. Four naming conventions coexist — dot.case, bare snake_case, a camelCase segment and a hyphen — and a code is a wire value a shipped client branches on, so they stay. New codes are dot.case, and the guard is what stops a fifth convention arriving unnoticed. Three families stay outside the list and say why: the assistant refusal builds its last segment from a template, the integration probes are enumerated per operation where the per-provider differences can be stated, and a route checking a credential of its own may answer 401 with no code. The guard re-derives the set from the tree and fails both ways — a code emitted and not listed, and a code listed and no longer emitted, which is the worse of the two because a client can write a branch for it and wait forever.