Class: DeidentifyError
Thrown for an author-time misconfiguration of deidentify (an unknown
Retain option, a malformed UID root). Distinct from the parser's fatal codes,
the value layer's DicomValueError, and the serializer's DicomSerializeError.
The message carries only structural facts (option names, the UID root) - never
a decoded value.
Example
import { deidentify, DeidentifyError } from "@cosyte/dicom";
try {
// @ts-expect-error - not a valid option
deidentify(ds, { retain: ["RetainEverything"] });
} catch (e) {
if (e instanceof DeidentifyError) console.error(e.code); // "INVALID_OPTIONS"
}
Extends
Error
Constructors
Constructor
new DeidentifyError(
message,code):DeidentifyError
Parameters
message
string
Human-readable, PHI-free description.
code
"INVALID_OPTIONS"
One of DEIDENTIFY_ERROR_CODES.
Returns
DeidentifyError
Overrides
Error.constructor
Properties
code
readonlycode:"INVALID_OPTIONS"