Skip to content

Commit

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

Add common net error processing
  • Loading branch information
ezewer authored Sep 2, 2024
2 parents 16f35ce + da30263 commit fb26991
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 @@ -87,6 +87,10 @@ const isSocketHangUpError = (err) => {
return /socket hang up/i.test(_getErrorString(err))
}

const isCommonNetError = (err) => {
return /net::ERR_/i.test(_getErrorString(err))
}

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

module.exports = {
Expand All @@ -135,6 +140,7 @@ module.exports = {
isBadGatewayError,
isDNSAvailabilityError,
isSocketHangUpError,
isCommonNetError,
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 @@ -43,6 +43,7 @@ const {
isBadGatewayError,
isDNSAvailabilityError,
isSocketHangUpError,
isCommonNetError,
isENetError,
isForbiddenError,
isMaintenanceError
Expand Down Expand Up @@ -97,6 +98,7 @@ module.exports = {
isBadGatewayError,
isDNSAvailabilityError,
isSocketHangUpError,
isCommonNetError,
isENetError,
isForbiddenError,
isMaintenanceError,
Expand Down

0 comments on commit fb26991

Please sign in to comment.