We used to retry on all thrown http errors:
|
(error !== null || (retryOptions.retryOnHttpResponse && (retryOptions.retryOnHttpResponse(response)))) |
Then when we refactored the code, the behavior changed and only retried on error.code 5xx which brought in this regression: #60
To be more thorough, we added a customizable function called retryOnHttpError and changed the default to retry on all FetchErrors: #63
The goal now is to expand the behavior (in addition to this change: #87) to call retryOnHttpError for all thrown errors, not just FetchError. This will make it easier to implement to make node-fetch-retry pluggable: #86
Developers can still use the custom retryOnHttpError function to add special behavior, like only retrying on FetchError's.
We used to retry on all thrown http errors:
node-fetch-retry/index.js
Line 29 in 4161e43
Then when we refactored the code, the behavior changed and only retried on
error.code5xx which brought in this regression: #60To be more thorough, we added a customizable function called
retryOnHttpErrorand changed the default to retry on all FetchErrors: #63The goal now is to expand the behavior (in addition to this change: #87) to call
retryOnHttpErrorfor all thrown errors, not justFetchError. This will make it easier to implement to make node-fetch-retry pluggable: #86Developers can still use the custom
retryOnHttpErrorfunction to add special behavior, like only retrying onFetchError's.