Skip to content

Commit

Permalink
removed the request body from the errors logged
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Mar 27, 2024
1 parent 1462dba commit f3a9a8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/contentstack-migration/src/utils/error-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,15 @@ module.exports = (errors, filePath) => {
messages.push(`${fileErrorsMessage}${errorMessages}`);
logger.log('error', errorLogs);
}
if (errors?.request) {
errors.data = errors.request?.data;
delete errors.request;
}
if (errors?.message) {
delete errors.message;
}
if (isEmpty(messages) && errors !== undefined && isEmpty(errorsByFile)) {
logger.log('error', errors);
logger.log('error', { errors: errors });
console.log(chalk`{bold.red Migration unsuccessful}`);
} else {
logger.log('error', { error: messages.join('\n') });
Expand Down

0 comments on commit f3a9a8b

Please sign in to comment.