admc / wd

A node.js client for webdriver/selenium 2.
Other
1.53k stars 402 forks source link

Configurable retry error code #548

Open RLovelett opened 5 years ago

RLovelett commented 5 years ago

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 5 years ago

@jlipps thoughts?

jlipps commented 5 years ago

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