Skip to main content

Type Alias: ReportCode

ReportCode = BuiltInReportCode | string & object

Defined in: model/error-report.ts:149

The machine-readable half of an Error report — kebab-case, and open at the tail so a plugin can mint its own (which ErrorReport.by's PluginId case requires). The shipped codes autocomplete; the (string & {}) tail is the same shape a FieldKey already uses.

A report code and a thrown code are two vocabularies, not one. This names what a fault reports; errors.ts's ThrownCode names what an exception carries. Two codes sit in both — 'mutation-cancelled' and 'unreadable-value' — because those faults do both. errors.test.ts holds that overlap to exactly two, so a third one added on either side fails to compile until it is named there on purpose (#333; unchecked convention before).