Skip to main content
Version: v0.0.3

Variable: SCRIPT_FATAL_CODES

const SCRIPT_FATAL_CODES: object

Fatal error codes for NCPDP SCRIPT parsing. A fatal is reserved for unrecoverable structural corruption: input that cannot be treated as a SCRIPT message at all. Everything recoverable is a warning instead (see "./warnings".SCRIPT_WARNING_CODES).

Type Declaration

EMPTY_INPUT

readonly EMPTY_INPUT: "EMPTY_INPUT" = "EMPTY_INPUT"

Input is empty or whitespace-only.

NO_MESSAGE_ROOT

readonly NO_MESSAGE_ROOT: "NCPDP_SCRIPT_NO_MESSAGE_ROOT" = "NCPDP_SCRIPT_NO_MESSAGE_ROOT"

Well-formed XML, but the root element is not a SCRIPT <Message>.

NOT_XML

readonly NOT_XML: "NCPDP_SCRIPT_NOT_XML" = "NCPDP_SCRIPT_NOT_XML"

Input is not well-formed XML, or carries a forbidden DOCTYPE/ENTITY.

UNSUPPORTED_VERSION

readonly UNSUPPORTED_VERSION: "NCPDP_SCRIPT_UNSUPPORTED_VERSION" = "NCPDP_SCRIPT_UNSUPPORTED_VERSION"

The declared SCRIPT version predates the XML SCRIPT era and is unsupported.

Example

import { SCRIPT_FATAL_CODES } from "@cosyte/ncpdp/common";
SCRIPT_FATAL_CODES.NOT_XML; // "NCPDP_SCRIPT_NOT_XML"