@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/servers.cjs CHANGED
@@ -527,7 +527,19 @@ function truncate(value, maxLength) {
527
527
  }
528
528
  return `${value.substring(0, maxLength)}...`;
529
529
  }
530
- function createToolError(toolName, args, exitCode, stderr6) {
530
+ var ToolExecutionError = class extends Error {
531
+ constructor(message, details) {
532
+ super(message);
533
+ __publicField(this, "stdout");
534
+ __publicField(this, "stderr");
535
+ __publicField(this, "exitCode");
536
+ this.name = "ToolExecutionError";
537
+ this.stdout = details.stdout;
538
+ this.stderr = details.stderr;
539
+ this.exitCode = details.exitCode;
540
+ }
541
+ };
542
+ function createToolError(toolName, args, exitCode, stderr6, stdout = "") {
531
543
  const argsStr = truncate(args.join(" "), MAX_ARGS_LENGTH);
532
544
  const stderrStr = truncate(stderr6.trim(), MAX_STDERR_LENGTH);
533
545
  const parts = [`${toolName} failed (exit code ${String(exitCode)})`];
@@ -537,7 +549,7 @@ function createToolError(toolName, args, exitCode, stderr6) {
537
549
  if (stderrStr.length > 0) {
538
550
  parts.push(`stderr: ${stderrStr}`);
539
551
  }
540
- return new Error(parts.join(" | "));
552
+ return new ToolExecutionError(parts.join(" | "), { stdout, stderr: stderr6, exitCode });
541
553
  }
542
554
  function createValidationError(toolName, zodError) {
543
555
  const parts = [];