From b74460af0869a2a5a5d42790f7eba1d83de9a90b Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Thu, 29 Aug 2024 12:06:51 +0300 Subject: [PATCH] Add dns availability error processing --- workers/loc.api/helpers/api-errors-testers.js | 8 +++++++- workers/loc.api/helpers/index.js | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/workers/loc.api/helpers/api-errors-testers.js b/workers/loc.api/helpers/api-errors-testers.js index f6b50a69..0e43fa7a 100644 --- a/workers/loc.api/helpers/api-errors-testers.js +++ b/workers/loc.api/helpers/api-errors-testers.js @@ -79,6 +79,10 @@ const isBadGatewayError = (err) => { return /Bad Gateway/i.test(_getErrorString(err)) } +const isDNSAvailabilityError = (err) => { + return /ERR_NAME_NOT_RESOLVED/i.test(_getErrorString(err)) +} + const isForbiddenError = (err) => { return /forbidden/i.test(_getErrorString(err)) } @@ -101,7 +105,8 @@ const isENetError = (err) => ( isEHostUnreachError(err) || isEProtoError(err) || isTempUnavailableError(err) || - isBadGatewayError(err) + isBadGatewayError(err) || + isDNSAvailabilityError(err) ) module.exports = { @@ -123,6 +128,7 @@ module.exports = { isEProtoError, isTempUnavailableError, isBadGatewayError, + isDNSAvailabilityError, isENetError, isForbiddenError, isMaintenanceError diff --git a/workers/loc.api/helpers/index.js b/workers/loc.api/helpers/index.js index 6f55dc03..f498eb9d 100644 --- a/workers/loc.api/helpers/index.js +++ b/workers/loc.api/helpers/index.js @@ -41,6 +41,7 @@ const { isEProtoError, isTempUnavailableError, isBadGatewayError, + isDNSAvailabilityError, isENetError, isForbiddenError, isMaintenanceError @@ -93,6 +94,7 @@ module.exports = { isEProtoError, isTempUnavailableError, isBadGatewayError, + isDNSAvailabilityError, isENetError, isForbiddenError, isMaintenanceError,