admc/wd

Configurable retry error code

Opened this issue · 2 comments

I want wd to retry on ECONNREFUSED in wd/lib/http-utils.js.

As of right now this does not seem possible.

The paths forward seem like:

  1. Modify the function shouldRetryOn to explicitly cover the ECONNREFUSED error code.
  2. Make it configurable via configureHttp and add it as an additional argument to shouldRetryOn.
  3. Something else I have not thought of?

Before I make a PR is there a preference for either 1 or 2?

admc commented

@jlipps thoughts?

i think i'd prefer option 2, since usually econnrefused means the server is not on and we want to provide that feedback immediately without bothering to retry