async-retry
async-retry copied to clipboard
The documentation for onRetry is wrong
The documentation currently says this:
onRetry: an optional Function that is invoked after a new retry is performed. It's passed the Error that triggered it as a parameter.
But it should say this:
onRetry: an optional Function that is invoked before a new retry is performed. It's passed the Error that triggered it as a parameter.
It's a small but significant difference.
I thought onRetry was useless because the docs say it runs after the retry. Then I tested and found it actually runs before the retry, which is much more useful. The docs should reflect that.
is it possible to "stop" the retry based on some condition?
EG only retry is status code == 501