From 81e945eae3fef0c3eb2fc4e039ca7dd6229fe352 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Sun, 24 Sep 2017 23:04:00 +0300 Subject: [PATCH] Add error logging for BookingBreakdown --- src/components/BookingBreakdown/BookingBreakdown.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/BookingBreakdown/BookingBreakdown.js b/src/components/BookingBreakdown/BookingBreakdown.js index 48d07130..55a0b568 100644 --- a/src/components/BookingBreakdown/BookingBreakdown.js +++ b/src/components/BookingBreakdown/BookingBreakdown.js @@ -8,6 +8,7 @@ import classNames from 'classnames'; import { types } from '../../util/sdkLoader'; import { formatMoney } from '../../util/currency'; import * as propTypes from '../../util/propTypes'; +import * as log from '../../util/log'; import css from './BookingBreakdown.css'; @@ -77,9 +78,10 @@ export const BookingBreakdownComponent = props => { if (isProvider) { if (!isValidCommission(providerCommissionLineItem)) { - // eslint-disable-next-line no-console - console.error('invalid commission line item:', providerCommissionLineItem); - throw new Error('Commission should be present and the value should be zero or negative'); + log.error( + new Error('Commission should be present and the value should be zero or negative'), + { providerCommissionLineItem: providerCommissionLineItem, transaction: transaction } + ); } // The total sum that the customer pays is the payinTotal. We use