Skip to content

Commit

Permalink
chore: added logging for the error types
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc committed Jun 10, 2024
1 parent ffb7831 commit 05ccc14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/v0/destinations/braze/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ async function processIdentify(message, destination) {
);
}

collectStatsForAliasFailure(brazeIdentifyResp, destination.ID);
collectStatsForAliasFailure(brazeIdentifyResp.response, destination.ID);
}

function processTrackWithUserAttributes(
Expand Down
12 changes: 5 additions & 7 deletions src/v0/destinations/braze/util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable */
const _ = require('lodash');
const get = require('get-value');
const { structuredLogger: logger } = require('@rudderstack/integrations-lib');
const stats = require('../../../util/stats');
const { handleHttpRequest } = require('../../../adapters/network');
const {
Expand Down Expand Up @@ -682,16 +683,13 @@ const collectStatsForAliasFailure = (brazeResponse, destinationId) => {
const { aliases_processed: aliasesProcessed, errors } = brazeResponse;
if (aliasesProcessed === 0) {
stats.increment('braze_alias_failure_count', { destination_id: destinationId });

Check warning on line 685 in src/v0/destinations/braze/util.js

View check run for this annotation

Codecov / codecov/patch

src/v0/destinations/braze/util.js#L685

Added line #L685 was not covered by tests
const errorType = [];

if (Array.isArray(errors)) {
errors.forEach((error) => {
errorType.push(error.type);
logger.info('Braze Alias Failure Errors:', {

Check warning on line 688 in src/v0/destinations/braze/util.js

View check run for this annotation

Codecov / codecov/patch

src/v0/destinations/braze/util.js#L688

Added line #L688 was not covered by tests
destinationId,
errors,
});
}
stats.increment('braze_alias_failure_error_type', {
destination_id: destinationId,
alias_error_type: errorType.join(','),
});
}
};

Expand Down

0 comments on commit 05ccc14

Please sign in to comment.