Add error logging for BookingBreakdown

This commit is contained in:
Hannu Lyytikainen 2017-09-24 23:04:00 +03:00
parent 8a595eda4e
commit 81e945eae3

View file

@ -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