Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(middleware-retry): defaultStrategy handles any error #2349

Merged
merged 2 commits into from
May 7, 2021

Conversation

AllanZhengYP
Copy link
Contributor

Resolves #2292

The lower level stacks than throw anything to retry strategy in
practice, so casting them to SdkError type is unsafe. With this
change the retryStrategy will do best effort to convert the
thrown any object to SdkError and then supply to retryDecider
and so on.

Another change is making SdkError type more general. It previously
requires $fault, $metadata, which is obviously incorrect. Error
thrown by SDK itself never contains these keys. So I mark them
optional. Granted this is a breaking change to function interface
like RetryDecider, but anyone depending it being required should
already fail anyway.

/cc @just-boris


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented May 4, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@2384e24). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 89f0057 differs from pull request most recent head a1650a7. Consider uploading reports for the commit a1650a7 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2349   +/-   ##
=======================================
  Coverage        ?   60.06%           
=======================================
  Files           ?      472           
  Lines           ?    24838           
  Branches        ?     5883           
=======================================
  Hits            ?    14918           
  Misses          ?     9920           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2384e24...a1650a7. Read the comment docs.

The lower level stacks than throw anything to retry strategy in
practice, so casting them to SdkError type is unsafe. With this
change the retryStrategy will do best effort to convert the
thrown any object to SdkError and then supply to retryDecider
and so on.

Another change is making SdkError type more general. It previously
requires $fault, $metadata, which is obviously incorrect. Error
thrown by SDK itself never contains these keys. So I mark them
optional. Granted this is a breaking change to function interface
like RetryDecider, but anyone depending it being required should
already fail anyway.
@AllanZhengYP AllanZhengYP merged commit e5b876f into aws:main May 7, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing @aws-sdk/client-s3 does not work in InternetExplorer
3 participants