Class: MllpFramingError
Thrown for unrecoverable MLLP wire-format violations.
code, stableWarningCodeidentifying the violationbyteOffset, absolute stream position where the violation was detectedsnippet, the single framing-boundary byte that broke the structure, or empty when the anomaly is not a specific byte. Never a run of payload content (see thesnippetPHI contract below); the constructor caps whatever it is given to 64 bytes as a backstop.
Example
// Pass only the offending framing-boundary byte, never a slice of payload content.
throw new MllpFramingError('MLLP_MISSING_LEADING_VT', byteOffset, Buffer.from([byte]));
Extends
Error
Constructors
Constructor
new MllpFramingError(
code,byteOffset,snippet,message?):MllpFramingError
Construct an MLLP framing error.
Parameters
code
The stable warning code classifying the violation.
byteOffset
number
Absolute stream byte offset where the violation was detected.
snippet
Buffer
Raw bytes copied from around the anomaly (capped to 64 bytes).
message?
string
Optional human-readable override message.
Returns
MllpFramingError
Overrides
Error.constructor
Properties
byteOffset
readonlybyteOffset:number
Absolute byte offset in the stream where the error was detected.
code
readonlycode:WarningCode
Stable warning code identifying the violation type.
name
readonlyname:"MllpFramingError"
Overrides
Error.name
snippet
readonlysnippet:Buffer
Up to 64 bytes copied from around the anomaly.
This is a copied Buffer, isolated from the source buffer so it remains valid after the underlying buffer is reused or overwritten.
PHI contract: the decoder only ever populates this with the single
framing-boundary byte that violated the frame structure (whose hex value the
message already discloses), never a run of payload content bytes. For anomalies
whose fault is not a specific byte (MLLP_FRAME_TOO_LARGE, the accumulated size),
the snippet is empty: a payload slice on a public error field would leak a
field-body slice of clinical content. Callers constructing this directly are
responsible for the same discipline.