Skip to main content
Version: v0.0.9

Class: NcpdpTelecomParseError

Thrown when NCPDP Telecommunication-standard input is structurally unrecoverable.

Carries a stable TelecomFatalCode and optional positional context, and nothing else. message is the TELECOM_FATAL_MESSAGES entry for the code, and it intentionally carries no snippet of the offending bytes: a Telecom message is PHI-dense, so the TelecomPosition (offset + field id, never a value) is the only context.

Example

try {
parseTelecom("");
} catch (err) {
if (err instanceof NcpdpTelecomParseError) {
err.code; // "EMPTY_INPUT"
}
}

Extends

  • Error

Constructors

Constructor

new NcpdpTelecomParseError(code, opts?): NcpdpTelecomParseError

Parameters

code

TelecomFatalCode

The stable fatal code, which selects the message.

opts?

Optional positional context.

position?

TelecomPosition

Returns

NcpdpTelecomParseError

Overrides

Error.constructor

Properties

code

readonly code: TelecomFatalCode

Stable, machine-readable fatal code.


position?

readonly optional position?: TelecomPosition

Byte-offset context of the failure, when known.