From 924bc15083937d0a899f83c012d39d770437010c Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Wed, 3 Jan 2018 17:31:27 +0100 Subject: [PATCH] feat: handle ENOTFOUND In some cases you may get this error even if the resource is actually accessible, I'm not sure why, but it happens. Retrying doesn't hurt --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a7d5208..9fc9953 100644 --- a/src/index.js +++ b/src/index.js @@ -25,7 +25,8 @@ function shouldRetry (err, res, allowedStatuses) { 'ECONNRESET', 'ETIMEDOUT', 'EADDRINFO', - 'ESOCKETTIMEDOUT' + 'ESOCKETTIMEDOUT', + 'ENOTFOUND' ] if (err && err.code && ~ERROR_CODES.indexOf(err.code)) {