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
docs/emitter-design: lower error payloads that are not error-flagged models #960
§3.1's PlannedError.Type is "an Error-flagged model", and §4.2's LowerErrors builds an "error type tree (APIError → client/server → concrete)" from plan.PlannedError, UsageFlags.Error and Fault. The golden spec here is the Cloudflare API schema (cloudflare/api-schemasopenapi.json at 911ad78), compiled with go run ./cmd/morphic compile openapi.json -o golden.ir.json at c387e25c. That command exits 1 on four unrelated errors and still writes the document. On it:
119 of 5,172 error payload contents, across 71 operations, are not models: 60 are primitives and 59 unions;
43 operations have an error case (their default) with no Fault;
A primitive or union error body cannot become a concrete type in an error tree whose leaves are models. A fault-less default has no place under client and server.
Direction
A proposal:
Non-model bodies. Wrap them in a generated error type that holds the decoded value, or raise a diagnostic.
Activity