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
The stable fatal code.
message
string
Human-readable, PHI-free description.
opts?
Optional positional context and bounded snippet.
position?
snippet?
string
Returns
NcpdpScriptParseError
Overrides
Error.constructor
Properties
code
readonlycode:ScriptFatalCode
Stable, machine-readable fatal code.
position?
readonlyoptionalposition?:ScriptPosition
XPath-style location of the failure, when known.
snippet?
readonlyoptionalsnippet?:string
Bounded (≤ 64-char) snippet of the offending input; redact before logging.