@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.js CHANGED
@@ -502,7 +502,19 @@ function truncate(value, maxLength) {
502
502
  }
503
503
  return `${value.substring(0, maxLength)}...`;
504
504
  }
505
- function createToolError(toolName, args, exitCode, stderr6) {
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 Error(parts.join(" | "));
527
+ return new ToolExecutionError(parts.join(" | "), { stdout, stderr: stderr6, exitCode });
516
528
  }
517
529
  function createValidationError(toolName, zodError) {
518
530
  const parts = [];