If someone in 2021 trying the Primitive version or ES6 version, for some reason the execution never gets to catch unless you add the processing of the success before it: so instead of
return fetch(url, options).catch(function(error)
you absolutely necessarily need to do return fetch(url, options).then(res => res.json()).catch(function(error)
or whatever processing of response you want to do in that .then()
you can still do next .then down the line from what fetch_retry returns you afterwards
But without this then fetch_retry doesn't actually attempt any retries as it never gets to catch, even though it got 500 server error in my case.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If someone in 2021 trying the Primitive version or ES6 version, for some reason the execution never gets to catch unless you add the processing of the success before it: so instead of
return fetch(url, options).catch(function(error)
you absolutely necessarily need to do
return fetch(url, options).then(res => res.json()).catch(function(error)
or whatever processing of response you want to do in that .then()
you can still do next .then down the line from what fetch_retry returns you afterwards
But without this then fetch_retry doesn't actually attempt any retries as it never gets to catch, even though it got 500 server error in my case.