chore(cli): improve error message for cdk migrate#29392
Conversation
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
|
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
|
@Mergifyio update |
✅ Branch has been successfully updated |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Reason for this change
This change is a follow-up to a PR that improved the error message thrown by
cdk-from-cfnwhen an invalid resource property was used in a CloudFormation template. This PR further improves the error message on the cli side.Description of changes
Primarily, this PR is a verbiage change. The base error message now states that the
<stack-name> could not be generated because <error-message>. The error message itself is checked againstunreachablebecause any use ofpanic!,unreachable!, orunimplemented!will cause thecdk-from-cfnsource code to panic in-place. In the resulting wasm binary, this produces aRuntimeErrorthat has an error message ofunreachable. I've improved this slightly by statingtemplate and/or language inputs caused the source code to panic. If the error message is notunreachable, then the error message is taken as is withTransmuteError:replaced.Note that we should still continue to improve our error messages in
cdk-from-cfnby by replacingpanic!,unreachable!, andunimplemented!with more detailed error messages.Description of how you validated changes
An existing unit test was changed based on the error message verbiage change. Additionally, a new unit test was added to validate that the expected error message would be thrown by the cli when an invalid resource property was used in a CloudFormation template.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license