Class: DicomSerializeError
Thrown by serializeDicom when a Dataset
cannot be emitted as spec-clean Part 10. Never carries a decoded value, so
it is safe to log without leaking PHI: the message is built only from the
code and the offending Transfer Syntax UID.
Example
import { parseDicom, serializeDicom, DicomSerializeError } from "@cosyte/dicom";
const ds = parseDicom(buf);
try {
serializeDicom(ds);
} catch (err) {
if (err instanceof DicomSerializeError && err.code === "MISSING_TRANSFER_SYNTAX") {
// dataset is missing the File Meta Transfer Syntax UID
}
}
Extends
Error
Constructors
Constructor
new DicomSerializeError(
code,message):DicomSerializeError
Internal
Construct a new DicomSerializeError. The message MUST be built only
from structural facts (never a decoded attribute value) so the error is
always safe to log.
Parameters
code
message
string
Returns
DicomSerializeError
Overrides
Error.constructor
Properties
code
readonlycode:SerializeErrorCode