adobe / adobe/node-fetch-retry
retry on all thrown fetch errors
- Dominant language
- JavaScript
- Stars
- 44
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
We used to retry on all thrown http errors: https://github.com/adobe/node-fetch-retry/blob/4161e438c4014f69a31f575578714764c17fdfee/index.js#L29
Then when we refactored the code, the behavior changed and only retried on `error.code` 5xx which brought in this regression: https://github.com/adobe/node-fetch-retry/issues/60
To be more thorough, we added a customizable function called `retryOnHttpError` and changed the default to retry on all FetchErrors: https://github.com/adobe/node-fetch-retry/pull/63
The goal now is to expand the behavior (in addition to this change: https://github.com/adobe/node-fetch-retry/issues/87) to call `retryOnHttpError` for all thrown errors, not just `FetchError`. This will make it easier to implement to make node-fetch-retry pluggable: https://github.com/adobe/node-fetch-retry/issues/86
Developers can still use the custom `retryOnHttpError` function to add special behavior, like only retrying on `FetchError`'s.
Contributor guide
Assessment
This issue has not been assessed yet.