-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-cfn
when 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 againstunreachable
because any use ofpanic!
,unreachable!
, orunimplemented!
will cause thecdk-from-cfn
source code to panic in-place. In the resulting wasm binary, this produces aRuntimeError
that 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-cfn
by 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