Merge pull request #872 from SiIky/chore/JbtevlHv/log_through_logger

Log through the logger
This commit is contained in:
Rafael Taranto 2021-11-11 18:32:06 +00:00 committed by GitHub
commit 1dd8f4ff7e
18 changed files with 66 additions and 42 deletions

View file

@ -23,6 +23,7 @@ const frontCameraBaseDir = _.get('frontCameraDir', options)
const operatorDataDir = _.get('operatorDataDir', options)
const sms = require('./sms')
const settingsLoader = require('./new-settings-loader')
const logger = require('./logger')
const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel']
@ -131,7 +132,7 @@ async function updateCustomer (id, data, userToken) {
Promise.all([getCustomerById(id), settingsLoader.loadLatest()])
.then(([customer, config]) => sms.getLookup(config, customer.phone))
.then(res => updateSubscriberData(id, res, userToken))
.catch(console.error)
.catch(logger.error)
}
invalidateCustomerNotifications(id, formattedData)
return getCustomerById(id)
@ -649,7 +650,7 @@ function updateIdCardData (patch, id) {
const imagesData = _.get('photos', patch)
return updatePhotos(imagesData, id, directory)
.then(newPatch => newPatch)
.catch(err => console.log('An error ocurred while saving the image ', err))
.catch(err => logger.error('while saving the image: ', err))
})
}