Skip to main content
Version: v0.0.9

Class: NcpdpScriptParseError

Thrown when NCPDP SCRIPT input is structurally unrecoverable.

Carries a stable ScriptFatalCode and optional positional context, and nothing else. message is the SCRIPT_FATAL_MESSAGES entry for the code, so the error, including its stack, is safe to log and safe to forward to an error reporter.

It carries no snippet of the offending input. An earlier version did, capped at 64 characters and documented as a redaction boundary; the cap bounded the length and nothing about the content, and the paths that raised it are exactly the paths where the input is too broken to say where in it those characters came from. NcpdpScriptBuildError and both Telecom errors had already refused a snippet for that reason. This one now agrees with them.

Example

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

Extends

  • Error

Constructors

Constructor

new NcpdpScriptParseError(code, opts?): NcpdpScriptParseError

Parameters

code

ScriptFatalCode

The stable fatal code, which selects the message.

opts?

Optional positional context.

position?

ScriptPosition

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.