Skip to content

Commit

Permalink
chore: addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik committed Sep 26, 2023
1 parent 3e589e7 commit 44f1048
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/v0/destinations/campaign_manager/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const tags = require('../../util/tags');

function checkIfFailuresAreRetryable(response) {
const { status } = response;
let isRetryable = true;
try {
if (Array.isArray(status)) {
// iterate over each status, and if found retryable in conversations ..retry else discard
Expand All @@ -26,19 +25,19 @@ function checkIfFailuresAreRetryable(response) {
"kind": string
}] */
for (const st of status) {
st.errors.forEach(err => {
for(const err of st.errors) {
// if code is any of these, event is not retryable
if (
err.code === 'PERMISSION_DENIED' ||
err.code === 'INVALID_ARGUMENT' ||
err.code === 'NOT_FOUND'
) {
isRetryable = false;
return false;
}
})
}
}
}
return isRetryable;
return true;
} catch (e) {
return true;
}
Expand Down

0 comments on commit 44f1048

Please sign in to comment.