Skip to main content
Version: v0.0.5

Variable: SYNTH_FATAL_CODES

const SYNTH_FATAL_CODES: object

The stable fatal code registry. Additions-only thereafter.

Type Declaration

SYNTH_EMPTY_POOL

readonly SYNTH_EMPTY_POOL: "SYNTH_EMPTY_POOL" = "SYNTH_EMPTY_POOL"

A value was drawn from an empty pool. Fatal - never a fabricated substitute.

SYNTH_INTENDED_WARNING_MISMATCH

readonly SYNTH_INTENDED_WARNING_MISMATCH: "SYNTH_INTENDED_WARNING_MISMATCH" = "SYNTH_INTENDED_WARNING_MISMATCH"

A bare parse of a freshly-generated quirk artifact did not produce exactly the declared intended warning code(s). Fatal - never emit a mislabeled fixture.

SYNTH_INVALID_DECIMAL

readonly SYNTH_INVALID_DECIMAL: "SYNTH_INVALID_DECIMAL" = "SYNTH_INVALID_DECIMAL"

A money value could not be read as an X12 decimal. Fatal - a generator never rounds to a float.

SYNTH_INVALID_PROFILE

readonly SYNTH_INVALID_PROFILE: "SYNTH_INVALID_PROFILE" = "SYNTH_INVALID_PROFILE"

A defineSynthProfile spec was not usable (a missing or blank name). Fatal.

SYNTH_INVALID_RANGE

readonly SYNTH_INVALID_RANGE: "SYNTH_INVALID_RANGE" = "SYNTH_INVALID_RANGE"

An integer range was requested with its maximum below its minimum. Fatal.

SYNTH_QUIRK_ANCHOR_ABSENT

readonly SYNTH_QUIRK_ANCHOR_ABSENT: "SYNTH_QUIRK_ANCHOR_ABSENT" = "SYNTH_QUIRK_ANCHOR_ABSENT"

A quirk transform found no structural anchor to mutate, so the fixture would not carry the deviation it is labelled with. Fatal - a golden file that lies about its parser verdict is worse than no golden file.

SYNTH_UNMAPPED_CODE_SYSTEM

readonly SYNTH_UNMAPPED_CODE_SYSTEM: "SYNTH_UNMAPPED_CODE_SYSTEM" = "SYNTH_UNMAPPED_CODE_SYSTEM"

A concept's code-system URI has no OID mapping in the C-CDA example-code table. Fatal.

SYNTH_UNSUPPORTED_FORMAT

readonly SYNTH_UNSUPPORTED_FORMAT: "SYNTH_UNSUPPORTED_FORMAT" = "SYNTH_UNSUPPORTED_FORMAT"

A format was requested that this build cannot generate through a real parser builder/serializer. Fatal - never a hand-written byte fallback.

No code path in this build raises it. All six formats generate, so it is reserved for a future format that does not, and is kept because removing a published code is a breaking change. An unsupported kind within a format that does generate is SYNTH_UNSUPPORTED_KIND.

SYNTH_UNSUPPORTED_KIND

readonly SYNTH_UNSUPPORTED_KIND: "SYNTH_UNSUPPORTED_KIND" = "SYNTH_UNSUPPORTED_KIND"

A caller-supplied selector (a message kind, a document type, a corpus mix entry, a claim variant, a Bundle type, a resource profile) is not in the closed set that governs it. Fatal - see resolveKind: a selector union is erased at run time, and a selector that falls through either mislabels the fixture or hands the value to a peer builder that quotes it back.

SYNTH_UNSUPPORTED_QUIRK

readonly SYNTH_UNSUPPORTED_QUIRK: "SYNTH_UNSUPPORTED_QUIRK" = "SYNTH_UNSUPPORTED_QUIRK"

A vendor quirk was requested that the target format's profile system does not support. Fatal - never a silent no-op and never a fabricated quirk.

Example

import { SYNTH_FATAL_CODES, SynthError } from "@cosyte/synth";
try {
// ...generate...
} catch (err) {
if (err instanceof SynthError && err.code === SYNTH_FATAL_CODES.SYNTH_UNSUPPORTED_FORMAT) {
// handle an unsupported format request
}
}