From 43729f626d36aac6f452d27f25d563d19cc46ed5 Mon Sep 17 00:00:00 2001 From: bijankhazaei Date: Fri, 15 Dec 2023 02:26:36 +0330 Subject: [PATCH 1/3] change AND to OR for handle more errors --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index b1eb7e4..bbabcf1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -112,7 +112,7 @@ Client.prototype._attachApi = function () { ); request(ariUrl, function (err) { - if (err && + if (err || ['ETIMEDOUT', 'ENOTFOUND', 'ECONNREFUSED'].indexOf(err.code) !== -1) { err.name = 'HostIsNotReachable'; From 62ea68b73675a78fc167c70599700cb808d89faf Mon Sep 17 00:00:00 2001 From: bijankhazaei Date: Fri, 15 Dec 2023 02:31:35 +0330 Subject: [PATCH 2/3] change AND to OR for handle more errors --- lib/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client.js b/lib/client.js index bbabcf1..a49af13 100644 --- a/lib/client.js +++ b/lib/client.js @@ -112,8 +112,8 @@ Client.prototype._attachApi = function () { ); request(ariUrl, function (err) { - if (err || - ['ETIMEDOUT', 'ENOTFOUND', 'ECONNREFUSED'].indexOf(err.code) !== -1) { + if (err && + ['ETIMEDOUT', 'ENOTFOUND', 'EPROTO', 'ECONNREFUSED'].indexOf(err.code) !== -1) { err.name = 'HostIsNotReachable'; self.emit('APILoadError', err); From 46f5218e7ca04eb499c8cf94e4c7ba1491c19e47 Mon Sep 17 00:00:00 2001 From: bijankhazaei Date: Fri, 15 Dec 2023 02:37:52 +0330 Subject: [PATCH 3/3] add another --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index a49af13..0eb5c53 100644 --- a/lib/client.js +++ b/lib/client.js @@ -113,7 +113,7 @@ Client.prototype._attachApi = function () { request(ariUrl, function (err) { if (err && - ['ETIMEDOUT', 'ENOTFOUND', 'EPROTO', 'ECONNREFUSED'].indexOf(err.code) !== -1) { + ['ETIMEDOUT', 'ENOTFOUND', 'EPROTO', 'DEPTH_ZERO_SELF_SIGNED_CERT', 'ECONNREFUSED'].indexOf(err.code) !== -1) { err.name = 'HostIsNotReachable'; self.emit('APILoadError', err);