node-attempt icon indicating copy to clipboard operation
node-attempt copied to clipboard

only retry on certain errors

Open pekeler opened this issue 7 years ago • 0 comments

I don't want to retry every error. So maybe onError should get a third parameter that could be used like

onError: function(err, done, abort) {
  if (err.code === 'ECONNREFUSED') {
    done(true);
  } else {
    abort();
  }
}

pekeler avatar Oct 07 '16 21:10 pekeler