The Wayback Machine - https://web.archive.org/web/20201204062145/https://github.com/sindresorhus/p-retry/pull/38
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

Feat/ignore fetch network error #38

Open
wants to merge 2 commits into
base: master
from

Conversation

@oreporan
Copy link

@oreporan oreporan commented Nov 19, 2020

Fixes issue #37

index.js Show resolved Hide resolved
@@ -38,7 +38,7 @@ const run = async () => {

Returns a `Promise` that is fulfilled when calling `input` returns a fulfilled promise. If calling `input` returns a rejected promise, `input` is called again until the maximum number of retries is reached. It then rejects with the last rejection reason.

It doesn't retry on `TypeError` as that's a user error.
It doesn't retry on `TypeError` as that's a user error. The only exclusion is fetchApi's 'Failed to fetch' error which can be a network error. See [the docs](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch), and [this issue](https://github.com/whatwg/fetch/issues/526)

This comment has been minimized.

@sindresorhus

sindresorhus Nov 24, 2020
Owner

I think this sentence could be written better.

You also need to update index.d.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.