Class: AstmProfileDefinitionError
Thrown by defineAstmProfile when a profile definition is invalid: a missing or
empty name, an unknown option key, an invalid transport value, or a
tolerate entry whose code is unknown, whose rationale is empty, or, the
load-bearing safety rule, whose code is safety-critical (a result value,
abnormal flag, result status, reference range, units, patient/comment context,
message-kind, code system, or any frame/LTP integrity warning). Carries the
offending profile's name when it is known, so a multi-profile build names the
culprit.
Example
import { defineAstmProfile, AstmProfileDefinitionError } from "@cosyte/astm";
try {
defineAstmProfile({
name: "unsafe",
tolerate: [{ code: "ASTM_FRAME_BAD_CHECKSUM", rationale: "no" }],
});
} catch (err) {
if (err instanceof AstmProfileDefinitionError) err.profileName; // "unsafe"
}
Extends
Error
Constructors
Constructor
new AstmProfileDefinitionError(
message,profileName?):AstmProfileDefinitionError
Internal
Construct a new AstmProfileDefinitionError.
Parameters
message
string
A human-readable explanation of what was invalid.
profileName?
string
The offending profile's name, when known.
Returns
AstmProfileDefinitionError
Overrides
Error.constructor
Properties
profileName?
readonlyoptionalprofileName?:string
The offending profile's name, when it could be read.