@ubercode/dcmtk 0.14.0 → 0.15.0
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/dicom.cjs +45 -33
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.js +45 -33
- package/dist/dicom.js.map +1 -1
- package/dist/index.cjs +166 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +166 -61
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +14 -2
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.js +14 -2
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +52 -37
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +18 -1
- package/dist/tools.d.ts +18 -1
- package/dist/tools.js +52 -38
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/dist/servers.js
CHANGED
|
@@ -502,7 +502,19 @@ function truncate(value, maxLength) {
|
|
|
502
502
|
}
|
|
503
503
|
return `${value.substring(0, maxLength)}...`;
|
|
504
504
|
}
|
|
505
|
-
|
|
505
|
+
var ToolExecutionError = class extends Error {
|
|
506
|
+
constructor(message, details) {
|
|
507
|
+
super(message);
|
|
508
|
+
__publicField(this, "stdout");
|
|
509
|
+
__publicField(this, "stderr");
|
|
510
|
+
__publicField(this, "exitCode");
|
|
511
|
+
this.name = "ToolExecutionError";
|
|
512
|
+
this.stdout = details.stdout;
|
|
513
|
+
this.stderr = details.stderr;
|
|
514
|
+
this.exitCode = details.exitCode;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
function createToolError(toolName, args, exitCode, stderr6, stdout = "") {
|
|
506
518
|
const argsStr = truncate(args.join(" "), MAX_ARGS_LENGTH);
|
|
507
519
|
const stderrStr = truncate(stderr6.trim(), MAX_STDERR_LENGTH);
|
|
508
520
|
const parts = [`${toolName} failed (exit code ${String(exitCode)})`];
|
|
@@ -512,7 +524,7 @@ function createToolError(toolName, args, exitCode, stderr6) {
|
|
|
512
524
|
if (stderrStr.length > 0) {
|
|
513
525
|
parts.push(`stderr: ${stderrStr}`);
|
|
514
526
|
}
|
|
515
|
-
return new
|
|
527
|
+
return new ToolExecutionError(parts.join(" | "), { stdout, stderr: stderr6, exitCode });
|
|
516
528
|
}
|
|
517
529
|
function createValidationError(toolName, zodError) {
|
|
518
530
|
const parts = [];
|