Skip to content

Commit

Permalink
Merge pull request #396 from ZIMkaRU/feature/extend-network-error-pro…
Browse files Browse the repository at this point in the history
…cessing

Add socket hang up error processing
  • Loading branch information
ezewer authored Sep 2, 2024
2 parents 3697cfc + c3d5416 commit 16f35ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion workers/loc.api/helpers/api-errors-testers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const isDNSAvailabilityError = (err) => {
return /ERR_NAME_NOT_RESOLVED/i.test(_getErrorString(err))
}

const isSocketHangUpError = (err) => {
return /socket hang up/i.test(_getErrorString(err))
}

const isForbiddenError = (err) => {
return /forbidden/i.test(_getErrorString(err))
}
Expand All @@ -106,7 +110,8 @@ const isENetError = (err) => (
isEProtoError(err) ||
isTempUnavailableError(err) ||
isBadGatewayError(err) ||
isDNSAvailabilityError(err)
isDNSAvailabilityError(err) ||
isSocketHangUpError(err)
)

module.exports = {
Expand All @@ -129,6 +134,7 @@ module.exports = {
isTempUnavailableError,
isBadGatewayError,
isDNSAvailabilityError,
isSocketHangUpError,
isENetError,
isForbiddenError,
isMaintenanceError
Expand Down
2 changes: 2 additions & 0 deletions workers/loc.api/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const {
isTempUnavailableError,
isBadGatewayError,
isDNSAvailabilityError,
isSocketHangUpError,
isENetError,
isForbiddenError,
isMaintenanceError
Expand Down Expand Up @@ -95,6 +96,7 @@ module.exports = {
isTempUnavailableError,
isBadGatewayError,
isDNSAvailabilityError,
isSocketHangUpError,
isENetError,
isForbiddenError,
isMaintenanceError,
Expand Down

0 comments on commit 16f35ce

Please sign in to comment.