Skip to main content
Version: v0.0.4

Class: AstmFrameStrictError

Thrown by decodeAstmFrames in strict mode when the lenient codec would otherwise have accumulated one or more frame warnings (a bad checksum, a sequence gap, an unterminated frame, or an oversize frame). Carries every warning (code + position, never the frame's record bytes) so a caller can see each deviation.

Example

import { decodeAstmFrames, AstmFrameStrictError } from "@cosyte/astm";
try {
decodeAstmFrames(someFramedBytes, { strict: true });
} catch (err) {
if (err instanceof AstmFrameStrictError) err.warnings.length; // >= 1
}

Extends

  • Error

Constructors

Constructor

new AstmFrameStrictError(warnings): AstmFrameStrictError

Internal

Parameters

warnings

readonly AstmFrameWarning[]

Returns

AstmFrameStrictError

Overrides

Error.constructor

Properties

warnings

readonly warnings: readonly AstmFrameWarning[]