polly-js
Transient exception handling for JavaScript
Polly-js is a library to help developers recover from transient errors using policies like retry or wait and retry.
Usage
Try to load the Google home page and rety twice if it fails
polly
.retry(2)
.executeForPromise(function () {
count++;
return requestPromise('http://www.google.com');
})
.then(function(result) {
console.log(result)
}, function(err) {
console.error('Failed trying three times', err)
});
Acknowledgements
The library is based on the Polly NuGet package by Michael Wolfenden