Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Mar 6, 2025

Fixes errors thrown from a CloudAssembly produced by a builder function are unstructured. Wrapping errors will allow better handling by implementors.

Also introduced the source property on ToolkitErrors as per the RFC, to denote the source of an error (user or toolkit).


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

@aws-cdk-automation aws-cdk-automation requested a review from a team March 6, 2025 12:38
@github-actions github-actions bot added the p2 label Mar 6, 2025
Comment on lines +3 to +6
const TOOLKIT_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ToolkitError');
const AUTHENTICATION_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AuthenticationError');
const ASSEMBLY_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AssemblyError');
const CONTEXT_PROVIDER_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ContextProviderError');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed these in the rename. They are private symbols, so it's fine.

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 98.38710% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.12%. Comparing base (6e0b7f2) to head (34dd191).

Files with missing lines Patch % Lines
packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   85.07%   85.12%   +0.04%     
==========================================
  Files         207      207              
  Lines       35706    35760      +54     
  Branches     4629     4632       +3     
==========================================
+ Hits        30378    30440      +62     
+ Misses       5171     5167       -4     
+ Partials      157      153       -4     
Flag Coverage Δ
suite.unit 85.12% <98.38%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mrgrain mrgrain added the pr/exempt-integ-test Skips the integ test steps if set. label Mar 6, 2025
@mrgrain mrgrain force-pushed the mrgrain/feat/wrap-all-builder-errors branch from 6965b21 to 580e8af Compare March 6, 2025 16:50
@mrgrain mrgrain force-pushed the mrgrain/feat/wrap-all-builder-errors branch from 580e8af to 34dd191 Compare March 6, 2025 18:56
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

youve addressed eli's comments and its late for him so im just going to approve

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Mar 6, 2025
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2025
…or (#200)

Fixes errors thrown from a CloudAssembly produced by a builder function
are unstructured. Wrapping errors will allow better handling by
implementors.

Also introduced the `source` property on `ToolkitError`s as per the RFC,
to denote the source of an error (user or toolkit).

---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license
Merged via the queue into main with commit e3b0856 Mar 6, 2025
11 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/feat/wrap-all-builder-errors branch March 6, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2 pr/exempt-integ-test Skips the integ test steps if set.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants