Open rittneje opened 1 week ago
Hey @rittneje , thanks for reaching out. So I tried different variations for printing the error message, here is what I observed
region
in the code , that value is printed --but if I try to print the account
value, its not printing anything (may be because the account is not resolved to anything as yet and would be given default value from config) -
This is how the method is implemented in CDK -
/**
* Adds an { "error": <message> } metadata entry to this construct.
* The toolkit will fail deployment of any stack that has errors reported against it.
* @param message The error message.
*/
public addError(message: string) {
this.addMessage(cxschema.ArtifactMetadataEntryType.ERROR, message);
}
I did not find any workaround for this so marking this as P2 as passing normal string works.
Marking as P2 means team won't immediately look into it but it would be on their radar and this issue would also be open for community contribution. Hope that helps!
Describe the bug
If we add an annotation via
aws_cdk.Annotations.of(x).add_error(...)
where the error message is an f-string contain a token, then it does not print out the error message properly.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
It should at least try to print the actual message.
Current Behavior
It prints
[object Object]
.Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.161.0
Framework Version
No response
Node.js Version
v22.9.0
OS
Alpine 3.20.3
Language
Python
Language Version
3.12.7
Other information
No response