Skip to main content
Version: v0.0.2

Class: X12ProfileError

Thrown by defineProfile() and profile-validation code when a profile definition is structurally invalid. Carries the offending profile name (when known) so consumers can pinpoint which definition failed.

Example

import { defineProfile, X12ProfileError } from "@cosyte/x12";
try {
defineProfile({ name: "" });
} catch (err) {
if (err instanceof X12ProfileError) {
console.error(err.message, err.profileName);
}
}

Extends

  • Error

Constructors

Constructor

new X12ProfileError(message, profileName?): X12ProfileError

Internal

Construct a new X12ProfileError. profileName is optional so the name validator can throw before a usable name is available.

Parameters

message

string

profileName?

string

Returns

X12ProfileError

Overrides

Error.constructor

Properties

profileName

readonly profileName: string | undefined