From 2a5dacc088f3fd6ca34587220fb986ec46c4fcea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Wed, 7 Jun 2023 16:41:48 +0100 Subject: [PATCH] fix: notification sending fails caused flows relying on it to break --- lib/email.js | 2 -- lib/notifier/index.js | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/email.js b/lib/email.js index 3dd5d6ee..2d96ea18 100644 --- a/lib/email.js +++ b/lib/email.js @@ -1,5 +1,3 @@ -// const configManager = require('./new-config-manager') -const logger = require('./logger') const ph = require('./plugin-helper') function sendMessage (settings, rec) { diff --git a/lib/notifier/index.js b/lib/notifier/index.js index 81baf3ba..ab75d84e 100644 --- a/lib/notifier/index.js +++ b/lib/notifier/index.js @@ -212,6 +212,7 @@ function complianceNotify (customer, deviceId, action, period) { notifyIfActive('compliance', 'customerComplianceNotify', customer, deviceId, action, period) return Promise.all(promises) + .catch(err => console.error(`An error occurred when sending a notification. Please check your notification preferences and 3rd party account configuration: ${err.stack}`)) }) } @@ -259,6 +260,7 @@ function sendTransactionMessage (rec, isHighValueTx) { if (webhookActive) promises.push(webhookFuncs.sendMessage(settings, rec)) return Promise.all(promises) + .catch(err => console.error(`An error occurred when sending a notification. Please check your notification preferences and 3rd party account configuration: ${err.stack}`)) }) } @@ -301,6 +303,7 @@ function cashboxNotify (deviceId) { notifyIfActive('security', 'cashboxNotify', deviceId) return Promise.all(promises) + .catch(err => console.error(`An error occurred when sending a notification. Please check your notification preferences and 3rd party account configuration: ${err.stack}`)) }) }