add ability to only retry certain errors
kilianc opened this issue · 1 comments
kilianc commented
this comes in handy when working with sockets and streams in general, you want to reattempt and recover as much as possible but fail fast in some cases.
tim-kos commented
Well, the way I do it is like this:
someFunction (err) ->
if err? && err.error in ["errors", "I", "want", "to", "retry"] && operation.retry(err)
return
Seems easy enough. I doubt a change to the retry module is necessary for this, as the types of errors will depend on your business/app logic. The retry module does not and should not need to know about them.