You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): use correct formatting for aggregate errors in aws-cdk (#32817)
Closes#32237
### Reason for this change
Sometimes when we print `e.message`, `e` is an `AggegateError` - so the
message text is incomplete/not formatted correctly. This PR adds a new
util function, `formatErrorMessage` which returns `e.message` if it
exists, or a correctly formatted string of errors if `e` is an
`AggregateError`.
### Description of changes
See `formatErrorMessage` function in the newly created file,
`packages/aws-cdk/lib/util/error.ts`. All other changes are grunt work
replacing `e.message` with `formateErrorMessage(e)`. This PR only does
the finding and replacing in the `aws-cdk` package, TBD whether we need
to do the same for the rest of the repo.
### Describe any new or updated permissions being added
None
### Description of how you validated changes
See unit tests in `packages/aws-cdk/test/api/util/error.test.ts`
### Checklist
- [x] My code adheres to the [CONTRIBUTING
GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and
[DESIGN
GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
---------
Signed-off-by: Sumu <[email protected]>
`Checking if the stack ${stack.stackName} exists before creating the changeset has failed, will base the diff on template differences (run again with -v to see the reason)\n`,
@@ -511,7 +512,7 @@ export class CdkToolkit {
511
512
// It has to be exactly this string because an integration test tests for
0 commit comments