@wraps.dev/cli 2.19.4 → 2.19.5

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/cli.js CHANGED
@@ -417,6 +417,7 @@ __export(errors_exports, {
417
417
  awsErrorToWrapsError: () => awsErrorToWrapsError,
418
418
  classifyDNSError: () => classifyDNSError,
419
419
  errors: () => errors,
420
+ extractPulumiErrorSummary: () => extractPulumiErrorSummary,
420
421
  handleCLIError: () => handleCLIError,
421
422
  isAWSError: () => isAWSError,
422
423
  isAWSNotFoundError: () => isAWSNotFoundError,
@@ -562,6 +563,38 @@ function sanitizeErrorMessage(error) {
562
563
  }
563
564
  return redacted;
564
565
  }
566
+ function extractPulumiErrorSummary(pulumiOutput) {
567
+ const lines = pulumiOutput.split("\n");
568
+ const errorLines = [];
569
+ let inErrorBlock = false;
570
+ for (const line of lines) {
571
+ const trimmed = line.trim();
572
+ if (trimmed.match(/^error:\s+\d+ error/i) || trimmed.match(/^error: one or more/i)) {
573
+ inErrorBlock = true;
574
+ }
575
+ if (inErrorBlock) {
576
+ if (trimmed.startsWith("err?:") || trimmed.startsWith("code:") || trimmed.startsWith("stdout:")) {
577
+ break;
578
+ }
579
+ if (trimmed) {
580
+ errorLines.push(trimmed);
581
+ }
582
+ continue;
583
+ }
584
+ if (trimmed.startsWith("error:") && !trimmed.includes("verification warning") && !trimmed.includes("is deprecated") || trimmed.startsWith("Error:") || trimmed.startsWith("Failed to ") || trimmed.startsWith("panic:")) {
585
+ errorLines.push(trimmed);
586
+ }
587
+ }
588
+ if (errorLines.length > 0) {
589
+ const summary = errorLines.slice(0, 15).join("\n");
590
+ return redactSensitiveValues(summary);
591
+ }
592
+ const redacted = redactSensitiveValues(pulumiOutput);
593
+ if (redacted.length > 1500) {
594
+ return `${redacted.slice(0, 1500)}...`;
595
+ }
596
+ return redacted;
597
+ }
565
598
  function handleCLIError(error, command) {
566
599
  const cmdContext = command || "unknown";
567
600
  if (isJsonMode()) {
@@ -27653,8 +27686,11 @@ ${pc35.bold("Cost Impact:")}`);
27653
27686
  trackError("STACK_LOCKED", "email:upgrade", { step: "deploy" });
27654
27687
  throw errors.stackLocked();
27655
27688
  }
27656
- trackError("UPGRADE_FAILED", "email:upgrade", { step: "deploy" });
27657
- throw new Error(`Pulumi upgrade failed: ${msg}`);
27689
+ trackError("UPGRADE_FAILED", "email:upgrade", {
27690
+ step: "deploy",
27691
+ error_detail: redactSensitiveValues(msg).slice(0, 3e3)
27692
+ });
27693
+ throw new Error(`Pulumi upgrade failed: ${extractPulumiErrorSummary(msg)}`);
27658
27694
  }
27659
27695
  let dnsAutoCreated = false;
27660
27696
  if (!isJsonMode() && outputs.domain && outputs.dkimTokens && outputs.dkimTokens.length > 0) {