Open trivikr opened 1 year ago
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.
Checkboxes for prior research
Describe the bug
When SDK introduces client side rate limiting in Retry Strategy, the error is swallowed
SDK version number
All, used v3.335.0 in testing
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
All, used v16.20.0 in testing
Reproduction Steps
Here is a repro which adds custom Handler which returns a Timeout for every call, and a retryStrategy with just 100ms delay between retries.
Observed Behavior
Error is thrown by the SDK with no info on why the error was thrown
Expected Behavior
Error thrown by the SDK with info on why the error was thrown
This error was thrown by updating the catch clause in
node_modules/@aws-sdk/middleware-retry/dist-cjs/retryMiddleware.js
as follows:Possible Solution
Update the catch clause in
retryMiddleware
to not swallow the error thrown by refreshRetryTokenForRetryAdditional Information/Context
"No retry token available"
error: https://github.com/aws/aws-sdk-js-v3/blob/7f8d884852a85eedc5b048afb13c89e80b94b7e1/packages/util-retry/src/StandardRetryStrategy.ts#L36refreshError
is swallowed and lastError is thrown with metadata: https://github.com/aws/aws-sdk-js-v3/blob/7f8d884852a85eedc5b048afb13c89e80b94b7e1/packages/middleware-retry/src/retryMiddleware.ts#L60-L67