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

retry on all thrown errors by default #90

Merged
merged 5 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,8 @@ function checkParameters(retryOptions) {
* @param {Object} error
* @returns Returns true for all FetchError's of type `system`
*/
function shouldRetryOnHttpError(error) {
// special handling for known fetch errors: https://github.com/node-fetch/node-fetch/blob/main/docs/ERROR-HANDLING.md
// retry on all errors originating from Node.js core
// retry on AbortError caused by network timeouts
if (error.name === 'FetchError' && error.type === 'system') {
console.error(`FetchError failed with code: ${error.code}; message: ${error.message}`);
return true;
} else if (error.name === 'AbortError') {
console.error(`AbortError failed with type: ${error.type}; message: ${error.message}`);
return true;
}
return false;
function shouldRetryOnHttpError() {
return true;
jdelbick marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Loading