Skip to main content
Version: v0.0.3

Class: NcpdpTelecomParseError

Thrown when NCPDP Telecommunication-standard input is structurally unrecoverable.

Carries a stable TelecomFatalCode and optional positional context. It intentionally never carries a snippet of the offending bytes: a Telecom message is PHI-dense and a byte-level snippet could leak a value, 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, message, opts?): NcpdpTelecomParseError

Parameters

code

TelecomFatalCode

The stable fatal code.

message

string

Human-readable, PHI-free description.

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.