From 1665e1acf637949dde93c3304c6d60287ed1c435 Mon Sep 17 00:00:00 2001 From: Naira Petrosyan Date: Mon, 12 Feb 2024 18:51:15 +0400 Subject: [PATCH] fix: when err.code is not numeric or doesnot exist take err.response.status instead --- lib/file_transfer_agent/gcs_util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/file_transfer_agent/gcs_util.js b/lib/file_transfer_agent/gcs_util.js index b72d9ef91..3cf6a0e2b 100644 --- a/lib/file_transfer_agent/gcs_util.js +++ b/lib/file_transfer_agent/gcs_util.js @@ -178,7 +178,7 @@ function GCSUtil(httpclient, filestream) { encryptionMetadata ); } catch (err) { - const errCode = err['code'] ? err['code'] : err.response.status; + const errCode = !isNaN(err['code']) && !isNaN(parseInt(err['code'])) ? err['code'] : err.response.status; if ([403, 408, 429, 500, 503].includes(errCode)) { meta['lastError'] = err;