From 64b96ff5082ddbb9fa0fa9152deafc77770991e5 Mon Sep 17 00:00:00 2001 From: Eeli Jokinen Date: Thu, 16 Jul 2015 11:33:24 +0300 Subject: [PATCH] add EAI_AGAIN to the list of retriable network errors --- README.md | 2 +- strategies/NetworkError.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a49edd..148a348 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![npm](https://nodei.co/npm/requestretry.png)](https://npmjs.org/package/requestretry) -When the connection fails with one of `ECONNRESET`, `ENOTFOUND`, `ESOCKETTIMEDOUT`, `ETIMEDOUT`, `ECONNREFUSED`, `EHOSTUNREACH`, `EPIPE` or when an HTTP 5xx error occurrs, the request will automatically be re-attempted as these are often recoverable errors and will go away on retry. +When the connection fails with one of `ECONNRESET`, `ENOTFOUND`, `ESOCKETTIMEDOUT`, `ETIMEDOUT`, `ECONNREFUSED`, `EHOSTUNREACH`, `EPIPE`, `EAI_AGAIN` or when an HTTP 5xx error occurrs, the request will automatically be re-attempted as these are often recoverable errors and will go away on retry. ## Usage diff --git a/strategies/NetworkError.js b/strategies/NetworkError.js index 956f3d7..46d8d2a 100644 --- a/strategies/NetworkError.js +++ b/strategies/NetworkError.js @@ -1,6 +1,6 @@ 'use strict'; -var RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE']; +var RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN']; var _ = require('fg-lodash'); /**