Skip to content

Commit

Permalink
docs: add comments in response handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravudia committed Feb 2, 2024
1 parent 00f4ec8 commit 354fe58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/v0/destinations/the_trade_desk/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ const responseHandler = (destinationResponse) => {
);
}

// Trade desk returns 200 with an error in case of "Failed to parse TDID, DAID, UID2, IDL, EUID, or failed to decrypt UID2Token or EUIDToken"
// Trade desk first party data api returns 200 with an error in case of "Failed to parse TDID, DAID, UID2, IDL, EUID, or failed to decrypt UID2Token or EUIDToken"
// https://partner.thetradedesk.com/v3/portal/data/doc/post-data-advertiser-external
// {"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid DAID, item #1"}]}
// For real time conversion api we don't have separate response handling, trade desk always return 400 for bad events.
if ('FailedLines' in response && response.FailedLines.length > 0) {
throw new AbortedError(
`Request failed with status: ${status} due to ${JSON.stringify(response)}`,
Expand All @@ -78,7 +79,7 @@ const responseHandler = (destinationResponse) => {
}

// else successfully return status, message and original destination response
// Trade desk returns 200 with empty object '{}' in response if all the events are processed successfully
// For first party api trade desk returns 200 with empty object '{}' in response if all the events are processed successfully
return {
status,
message,
Expand Down

0 comments on commit 354fe58

Please sign in to comment.