Skip to content

fix: fatal failures hide the underlying error cause - #1939

Merged
aws-cdk-automation merged 1 commit into
mainfrom
mrgrain/fix/more-error-details
Sep 3, 2026
Merged

fix: fatal failures hide the underlying error cause#1939
aws-cdk-automation merged 1 commit into
mainfrom
mrgrain/fix/more-error-details

Conversation

@mrgrain

@mrgrain mrgrain commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

When a deployment fails, the CLI now tells you what actually went wrong instead of just which stack it happened in.

Previously a fatal failure was flattened into a single line like ❌ Test-Stack-A failed: ResourceNotReady: <message>. That line was assembled by hand and thrown as a new error, discarding the original one — so anything nested below the first level was invisible. The AWS API error that ultimately caused the failure never made it to your terminal, and --debug didn't help either because the trace stopped at the first cause.

Failures now keep the original error attached as a cause, and the CLI prints the entire chain, one ‣ <name>: <message> line per level. You get the stack that failed, the CDK-level reason, and the underlying service error in one go, without re-running anything. With --debug you additionally get a stack trace for every level of the chain rather than only the outermost one.

Hotswap failures benefit the most from this. Errors coming out of a hotswap deployment are now labelled with the service responsible, so in a deployment touching several resources you can see which one broke instead of guessing. Cloud Control update failures previously surfaced as bare API errors with no hint of their origin; they now name the resource identifier and type that failed to update.

The two test apps switch from Stack.addDependency to addStackDependency — the former is deprecated in current aws-cdk-lib, and the deprecation output is annoying.

Before

image

After

image

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed
    • Release notes for the new version:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@mrgrain
mrgrain deployed to automation September 3, 2026 12:58 — with GitHub Actions Active
@mrgrain
mrgrain deployed to automation September 3, 2026 12:58 — with GitHub Actions Active
@mrgrain
mrgrain deployed to no-approval September 3, 2026 12:58 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added the p2 label Sep 3, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team September 3, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants