Skip to main content
Version: v0.0.2

Class: Premium820BuildError

Thrown by "./build-820.js".build820 when the supplied premium spec cannot be emitted as a conformant, self-consistent 820. Carries a stable code for programmatic narrowing. Deliberately does NOT extend X12ParseError or X12BuildError - the domain-refusal distinction matters at the type level.

Example

import { Premium820BuildError } from "@cosyte/x12";
try {
build820(spec);
} catch (err) {
if (err instanceof Premium820BuildError) {
// err.code is one of PREMIUM_820_BUILD_ERROR_CODES
}
}

Extends

  • Error

Constructors

Constructor

new Premium820BuildError(code, message): Premium820BuildError

Internal

Parameters

code

"X12_820_BUILD_INVALID_SPEC"

message

string

Returns

Premium820BuildError

Overrides

Error.constructor

Properties

code

readonly code: "X12_820_BUILD_INVALID_SPEC"