@ubercode/dcmtk 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -19
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +13 -19
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.js +13 -19
- package/dist/servers.js.map +1 -1
- package/package.json +1 -1
package/dist/servers.js
CHANGED
|
@@ -3398,29 +3398,23 @@ var DicomReceiver = class _DicomReceiver extends EventEmitter {
|
|
|
3398
3398
|
}
|
|
3399
3399
|
/** Parses a DICOM file and emits INSTANCE_RECEIVED or error. */
|
|
3400
3400
|
emitInstanceReceived(filePath, fileSize, data, ctx) {
|
|
3401
|
+
const errorCtx = {
|
|
3402
|
+
filePath,
|
|
3403
|
+
associationId: ctx.associationId,
|
|
3404
|
+
associationDir: ctx.associationDir,
|
|
3405
|
+
callingAE: data.callingAE,
|
|
3406
|
+
calledAE: data.calledAE,
|
|
3407
|
+
source: data.source
|
|
3408
|
+
};
|
|
3401
3409
|
void DicomInstance.open(filePath).then((openResult) => {
|
|
3402
3410
|
if (!openResult.ok) {
|
|
3403
|
-
this.emit("error", {
|
|
3404
|
-
error: openResult.error,
|
|
3405
|
-
filePath,
|
|
3406
|
-
associationId: ctx.associationId,
|
|
3407
|
-
associationDir: ctx.associationDir,
|
|
3408
|
-
callingAE: data.callingAE,
|
|
3409
|
-
calledAE: data.calledAE,
|
|
3410
|
-
source: data.source
|
|
3411
|
-
});
|
|
3411
|
+
this.emit("error", { error: openResult.error, ...errorCtx });
|
|
3412
3412
|
return;
|
|
3413
3413
|
}
|
|
3414
|
-
this.emit("INSTANCE_RECEIVED", {
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
associationDir: ctx.associationDir,
|
|
3419
|
-
callingAE: data.callingAE,
|
|
3420
|
-
calledAE: data.calledAE,
|
|
3421
|
-
source: data.source,
|
|
3422
|
-
instance: openResult.value
|
|
3423
|
-
});
|
|
3414
|
+
this.emit("INSTANCE_RECEIVED", { ...errorCtx, fileSize, instance: openResult.value });
|
|
3415
|
+
}).catch((thrown) => {
|
|
3416
|
+
const error = thrown instanceof Error ? thrown : new Error(String(thrown));
|
|
3417
|
+
this.emit("error", { error, ...errorCtx });
|
|
3424
3418
|
});
|
|
3425
3419
|
}
|
|
3426
3420
|
/** Returns worker to idle pool on association complete, emits summary. */
|