There is a discrepancy in how Smithy TypeScript generates waiter functions to handle error codes and their corresponding modeled exceptions. The issue arises because the generated TypeScript code uses the name property of the exception to match errors, but the actual error names returned by AWS differ from the error codes defined in the Smithy model.
Root cause is likely that the WaiterGenerator.java code refers to error.name, whereas awsQueryError needs proper matching.
Example
The Smithy model might define an error with the awsQueryError code DBInstanceNotFound, but the actual exception name returned by AWS is DBInstanceNotFoundFault. This leads to incorrect error matching in the generated code, causing waiter functions to either hang indefinitely or fail to transition correctly when the desired resource state is reached.
Issue Description:
There is a discrepancy in how Smithy TypeScript generates waiter functions to handle error codes and their corresponding modeled exceptions. The issue arises because the generated TypeScript code uses the name property of the exception to match errors, but the actual error names returned by AWS differ from the error codes defined in the Smithy model. Root cause is likely that the
WaiterGenerator.java
code refers to error.name, whereasawsQueryError
needs proper matching.Example
The Smithy model might define an error with the
awsQueryError
codeDBInstanceNotFound
, but the actual exception name returned by AWS isDBInstanceNotFoundFault
. This leads to incorrect error matching in the generated code, causing waiter functions to either hang indefinitely or fail to transition correctly when the desired resource state is reached.Smithy model definition:
Generated TypeScript code:
Expected Behavior:
The waiter function should correctly recognize the DBInstanceNotFoundFault exception and transition to the success state.
Current Behavior:
The waiter function fails to recognize the DBInstanceNotFoundFault exception, causing it to either hang indefinitely or not transition correctly.
related issue https://github.com/aws/aws-sdk-js-v3/issues/6084