Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry on all thrown fetch errors #88

Open
jdelbick opened this issue Apr 26, 2022 · 1 comment
Open

retry on all thrown fetch errors #88

jdelbick opened this issue Apr 26, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jdelbick
Copy link
Contributor

jdelbick commented Apr 26, 2022

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.

@jdelbick jdelbick self-assigned this Apr 26, 2022
@alexkli
Copy link
Contributor

alexkli commented Apr 26, 2022

Note that #87 should be done first so we don't blindly retry on developer errors in the callbacks.

@alexkli alexkli added this to the v3 milestone Apr 28, 2022
@alexkli alexkli added the enhancement New feature or request label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants