Skip to content

Commit

Permalink
fix: when err.code is not numeric or doesnot exist take err.response.…
Browse files Browse the repository at this point in the history
…status instead
  • Loading branch information
naira-petrosyan-m committed Feb 23, 2024
1 parent 195fda8 commit 569af67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/file_transfer_agent/gcs_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 569af67

Please sign in to comment.