Skip to main content
Version: v0.0.3

Class: NcpdpScriptParseError

Thrown when NCPDP SCRIPT input is structurally unrecoverable.

Carries a stable ScriptFatalCode, optional positional context, and an optional bounded snippet. The snippet is capped at 64 characters and is the documented consumer-redaction boundary: it may, by necessity, include a fragment of the offending input, so callers logging it must redact.

Example

try {
parseScript("not xml");
} catch (err) {
if (err instanceof NcpdpScriptParseError) {
err.code; // "NCPDP_SCRIPT_NOT_XML"
}
}

Extends

  • Error

Constructors

Constructor

new NcpdpScriptParseError(code, message, opts?): NcpdpScriptParseError

Parameters

code

ScriptFatalCode

The stable fatal code.

message

string

Human-readable, PHI-free description.

opts?

Optional positional context and bounded snippet.

position?

ScriptPosition

snippet?

string

Returns

NcpdpScriptParseError

Overrides

Error.constructor

Properties

code

readonly code: ScriptFatalCode

Stable, machine-readable fatal code.


position?

readonly optional position?: ScriptPosition

XPath-style location of the failure, when known.


snippet?

readonly optional snippet?: string

Bounded (≤ 64-char) snippet of the offending input; redact before logging.