Skip to content

Commit

Permalink
Merge pull request #5 from YotpoLtd/feature/YTPOS-65_cleanerLogMessage
Browse files Browse the repository at this point in the history
Skip order, seemingly corrupt/invalid, when the order has no products to send.
  • Loading branch information
mikefromgrr authored Jul 21, 2023
2 parents 856b00a + c4e33ea commit 739b6b1
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ function prepareOrderData(order, dateTimes) {
currency_iso: order.currencyCode,
products: products
});
} else {
throw new Error('Skipping order ' + orderNo + ' in the export due to empty products array. No products or gift cards in order.');
}

return orderData;
Expand Down

0 comments on commit 739b6b1

Please sign in to comment.