Skip to content

Commit

Permalink
fix: pardot router component test failure and remove unnecessary code
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Sep 14, 2023
1 parent d5eb31a commit 1f09629
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions src/v0/destinations/snapchat_custom_audience/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,9 @@ const scAudienceProxyRequest = async (request) => {
return response;
};

/**
* This function helps to determine type of error occurred. According to the response
* we set authErrorCategory to take decision if we need to refresh the access_token
* or need to disable the destination.
* @param {*} code
* @param {*} response
* @returns
*/
const getAuthErrCategory = (code, response) => {
let authErrCategory = '';
if (code === 401) {
authErrCategory = !response.error?.details ? REFRESH_TOKEN : '';
}
if (code === 403) {
authErrCategory = !response.error?.details ? AUTH_STATUS_INACTIVE : '';
}
return authErrCategory;
};

const scaAudienceRespHandler = (destResponse, stageMsg) => {
const { status, response } = destResponse;
const authErrCategory = getAuthErrCategoryFromErrDetailsAndStCode(status, response);
// const authErrCategory = getAuthErrCategory(status, response);

if (authErrCategory === REFRESH_TOKEN) {
throw new RetryableError(
Expand Down
2 changes: 1 addition & 1 deletion test/integrations/destinations/pardot/router/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ export const data = [
],
batched: false,
statusCode: 500,
error: 'Empty/Invalid access token',
error: 'OAuth - access token not found',
statTags: {
destType: 'PARDOT',
feature: 'router',
Expand Down

0 comments on commit 1f09629

Please sign in to comment.