wd
wd copied to clipboard
Configurable retry error code
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:
- Modify the function
shouldRetryOn
to explicitly cover theECONNREFUSED
error code. - Make it configurable via
configureHttp
and add it as an additional argument toshouldRetryOn
. - Something else I have not thought of?
Before I make a PR is there a preference for either 1 or 2?
@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