Skip to content

retry on all thrown fetch errors #88

@jdelbick

Description

@jdelbick

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions