-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: error message is sometimes empty #32237
Labels
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p1
package/tools
Related to AWS CDK Tools or CLI
Comments
rix0rrr
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Nov 21, 2024
ashishdhingra
added
p2
effort/small
Small work item – less than a day of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Nov 21, 2024
Labeling this as |
Adding to Programmatic Toolkit work since we are touching this anyway. |
2 tasks
See also #32481 |
1 task
sumupitchayan
added a commit
that referenced
this issue
Jan 13, 2025
…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]>
Comments on closed issues and PRs are hard for our team to see. |
iankhou
pushed a commit
that referenced
this issue
Jan 13, 2025
…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]>
mrgrain
pushed a commit
that referenced
this issue
Jan 14, 2025
…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]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p1
package/tools
Related to AWS CDK Tools or CLI
Describe the bug
Sometimes when we print
e.message
, it turns out thate
is anAggregateError
without amessage
defined itself.In those cases, we should probably build a message out of the messages of the errors inside the AggregateError.
I'm not sure where these can originate, but the SDKv3 sometimes produces errors like this.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError
Regression Issue
Last Known Working CDK Version
No response
Framework Version
No response
Node.js Version
OS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: