aws-samples / aws-cdk-examples

Example projects using the AWS CDK
Apache License 2.0
4.96k stars 2.1k forks source link

Example has ternary statements in wrong order #926

Closed stephenkelzer closed 9 months ago

stephenkelzer commented 9 months ago

Describe the bug

I was working with one of the lambda examples for a personal project and I realized that the ternary statement in two of the examples were inverse from what should be expected.

Expected Behavior

When an error includes reserved keyword, I would expect to have the RESERVED_RESPONSE error be returned.

Current Behavior

When an error includes reserved keyword, the DYNAMODB_EXECUTION_ERROR error is returned.

Reproduction Steps

I copy and pasted the code from the following two examples:

When using a reserved keyword, the wrong error is shown.

Possible Solution

I will be opening a PR to swap these error messages.

Additional Information/Context

No response

CDK CLI Version

2.99.0

Framework Version

No response

Node.js Version

18.18.0

OS

Linux

Language

Typescript

Language Version

5.2.2

github-actions[bot] commented 9 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.