Skip to main content
Version: v0.0.4

Class: ProfileDefinitionError

Thrown by defineProfile() when the supplied options are invalid.

Example

import { defineProfile, ProfileDefinitionError } from "@cosyte/dicom";
try {
defineProfile({ name: "" });
} catch (err) {
if (err instanceof ProfileDefinitionError) {
console.error(err.message); // "Profile name must be a non-empty string."
}
}

Extends

  • Error

Constructors

Constructor

new ProfileDefinitionError(message, profileName?): ProfileDefinitionError

Parameters

message

string

Actionable description of what made the options invalid.

profileName?

string

The offending profile's name, when known.

Returns

ProfileDefinitionError

Overrides

Error.constructor

Properties

profileName?

readonly optional profileName?: string

The offending profile's name when known (undefined when the failure is the name itself). Lets callers attribute a composed-lineage failure to the specific profile that introduced it.