Skip to main content

Type Alias: BuiltInThrownCode

BuiltInThrownCode = "unsupported-unit" | "invalid-snap-increment" | "container-not-found" | "invalid-instant" | "invalid-plain-time" | "unknown-preset" | "invalid-preset" | "entry-not-found" | "reveal-target-not-found" | "duplicate-entry-id" | "parent-cycle" | "inverted-span" | "unknown-field" | "duplicate-field-key" | "reserved-field-key" | "duplicate-props-key" | "illegal-core-field-override" | "computed-field-cannot-be-written" | "field-not-editable" | "derived-field-not-writable" | "unknown-aggregator" | "unknown-field-type" | "aggregator-failed" | "field-column-not-defined" | "toggle-field-not-boolean" | "unknown-grid-column" | "mutation-during-notification" | "mutation-during-extension-hook" | "transaction-already-open" | "mutation-cancelled" | "unreadable-value" | "invalid-replay-origin" | "duplicate-row-id" | "duplicate-plugin-id" | "plugin-not-installed" | "missing-plugin" | "plugin-requirement-cycle" | "registration-closed" | "plugin-setup-failed" | "renderer-already-registered" | "unknown-command" | "empty-covers" | "custom-row-source-not-filterable-or-sortable" | "sibling-index-out-of-range" | "place-refused" | "remove-refused"

Defined in: model/errors.ts:39

Every code a consumer can catch, one closed union (#333, narrowed by #380). Every super(…) below writes its literal satisfies BuiltInThrownCode, so super('invlid-instant') is a compile error rather than a shipped typo.

satisfies at each site, and not a narrower base class the built-ins extend. That base reaches the published .d.ts through 42 extends clauses, so API Extractor asks for it to be exported — and a class whose one job is to narrow this repo's codes must not become a class a consumer can extend. satisfies checks the same literal, costs nothing at runtime, and leaves FreeGanttError the one base a consumer ever sees.

Every code here has a FreeGanttError subclass a consumer can catch. A code that reports an internal invariant no consumer can reach is InternalThrownCode instead — it stays off this union, and off switch (error.code)'s autocomplete, because a consumer cannot act on it (#380).

A thrown code is not a report code. This names what an exception carries; error-report.ts's BuiltInReportCode names what a recovered fault reports. Two codes sit in both, and errors.test.ts holds that overlap to exactly two.