Skip to content

Commit

Permalink
fix: updated connection reset string (#1632)
Browse files Browse the repository at this point in the history
* fix: updated connection reset string

* updated test
  • Loading branch information
shaffeeullah committed Oct 1, 2021
1 parent 3d99e53 commit b841d5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const RETRYABLE_ERR_FN_DEFAULT = function (err?: ApiError) {
const reason = e.reason?.toLowerCase();
if (
(reason && reason.includes('eai_again')) || //DNS lookup error
reason === 'connection reset by peer' ||
reason === 'econnreset' ||
reason === 'unexpected connection closure'
) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe('Storage', () => {
const error = new ApiError('Connection Reset By Peer error');
error.errors = [
{
reason: 'Connection Reset By Peer',
reason: 'ECONNRESET',
},
];
assert.strictEqual(calledWith.retryOptions.retryableErrorFn(error), true);
Expand Down

0 comments on commit b841d5b

Please sign in to comment.