Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Utsab Chowdhury <[email protected]>
  • Loading branch information
shrouti1507 and utsabc authored Jan 25, 2024
1 parent ba24539 commit 1c3ea6b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/v0/destinations/marketo_bulk_upload/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ const getAccessToken = async (config) => {
});

// sample response : {response: '[ENOTFOUND] :: DNS lookup failed', status: 400}
if (
isDefinedAndNotNull(accessTokenResponse.status) &&
!isHttpStatusSuccess(accessTokenResponse.status)
if (!isHttpStatusSuccess(accessTokenResponse.status)
) {
throw new NetworkError(
`Could not retrieve authorisation token due to error ${JSON.stringify(accessTokenResponse)}`,
Expand Down Expand Up @@ -163,9 +161,9 @@ const getAccessToken = async (config) => {
}
return accessTokenResponse.response.access_token;
}
throw new AbortedError(
throw new RetyrableError(
`Could not retrieve authorisation token due to error ${JSON.stringify(accessTokenResponse)}`,
400,
500,
);
};

Expand Down

0 comments on commit 1c3ea6b

Please sign in to comment.