adobe / adobe/node-fetch-retry

handle developer errors from callbacks separate from fetch errors

Open
#87 4 comments 0 reactions 1 assignee Claimed by @alexkli View on GitHub
bug
Dominant language
JavaScript
Stars
44
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Currently we share the same catch clause for `fetch()` and for the `shouldRetry()` here: https://github.com/adobe/node-fetch-retry/blob/3e512e5a6a892e0bd51c862d8fd1abdbdf1b4c57/index.js#L217-L227

shouldRetry includes calling the callbacks `retryOnHttpError()` and `retryOnHttpResponse()`. These callbacks could have developer errors on which we should not retry blindly.

Instead, we should separate the error handling, and for errors on the callbacks pass them through as clear errors (and do not retry) so the developers can fix their code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.