get-it
Version:
Generic HTTP request library for node, browsers and workers
15 lines (11 loc) • 346 B
text/typescript
import allowed from 'is-retry-allowed'
export default (err: any, _num: number, options: any) => {
if (options.method !== 'GET' && options.method !== 'HEAD') {
return false
}
// Don't allow retries if we get any http status code by default
if (err.response && err.response.statusCode) {
return false
}
return allowed(err)
}