Skip to content

docs/emitter-design: lower error payloads that are not error-flagged models #960

Closed

Description

@OmarAlJarrah

Problem

§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-schemas openapi.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:

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:

Done when every error case of the golden spec gets a PlannedError and a place in the tree from a rule in §3.1 or §4.2.

Out of scope

Envelope-reported failures inside a success status (#695).

Related: #447, #608, #695

Priority: P1, rule 5 (direct impact: the error lowering of 71 golden operations). jq '.types as $T | [.. | objects | select(.errors? and (.id|type)=="string") | .errors[] | .payload.contents[]? | $T[.type.target].kind | select(. != "model")] | length' golden.ir.json → 119 (spec @911ad78, morphic @c387e25c).

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P1Core first-emitter feature on mainstream specstype:docsDocumentation only

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions