Skip to content

Commit

Permalink
chore: pardot oboard to new component structure
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik committed Mar 7, 2024
1 parent 135bb49 commit a8cdcb9
Show file tree
Hide file tree
Showing 7 changed files with 672 additions and 415 deletions.
14 changes: 14 additions & 0 deletions src/v0/destinations/pardot/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ const getStatus = (code) => {
const pardotRespHandler = (destResponse, stageMsg) => {
const { status, response } = destResponse;
const respAttributes = response['@attributes'];

// to handle errors like service unavilable, wrong url, no response
if (!respAttributes) {
throw new NetworkError(
`${JSON.stringify(response)} ${stageMsg}`,
status,
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status),
},
response,
getAuthErrCategory(status),
);
}

const { stat, err_code: errorCode } = respAttributes;

if (isHttpStatusSuccess(status) && stat !== 'fail') {
Expand Down
Loading

0 comments on commit a8cdcb9

Please sign in to comment.