From e4cd42789ef04b9be664b65704267fc6ff6d4fe9 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:37:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=85=20catch=20error=20not=20on=20get?= =?UTF-8?q?=20key=20prices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Pricelist.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/classes/Pricelist.ts b/src/classes/Pricelist.ts index 6a0243741..89970d6d6 100644 --- a/src/classes/Pricelist.ts +++ b/src/classes/Pricelist.ts @@ -647,7 +647,13 @@ export default class Pricelist extends EventEmitter { return; } - return this.updateOldPrices(old); + return this.updateOldPrices(old) + .then(() => { + log.debug('Done update old prices...'); + }) + .catch(err => { + log.error('Error on updateOldPrices', err); + }); }) .catch(err => { log.debug('❌ Unable to get key prices: ', err); From 55dc67266d8ea6dfc51f85f7bb7751d74cf2a18d Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:46:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20small=20fix,=20change=20log?= =?UTF-8?q?=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Pricelist.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/Pricelist.ts b/src/classes/Pricelist.ts index 89970d6d6..5fb1124fd 100644 --- a/src/classes/Pricelist.ts +++ b/src/classes/Pricelist.ts @@ -652,7 +652,7 @@ export default class Pricelist extends EventEmitter { log.debug('Done update old prices...'); }) .catch(err => { - log.error('Error on updateOldPrices', err); + log.error('Error on updateOldPrices:', err); }); }) .catch(err => { @@ -790,7 +790,7 @@ export default class Pricelist extends EventEmitter { currPrice.enabled = false; currPrice.group = 'failed-updateOldPrices'; this.failedUpdateOldPrices.push(sku); - log.warn(`updateOldPrices failed for ${sku}`, err); + log.error(`updateOldPrices failed for ${sku}`, err); pricesChanged = true; }