Merge pull request #1553 from chaotixkilla/fix-notifications-breaking-cashbox-removal

[LAM-622] Fix notification sending fails causing flows to break
This commit is contained in:
Rafael Taranto 2023-06-12 11:13:20 +01:00 committed by GitHub
commit 18ca872d05
2 changed files with 3 additions and 2 deletions

View file

@ -1,5 +1,3 @@
// const configManager = require('./new-config-manager')
const logger = require('./logger')
const ph = require('./plugin-helper') const ph = require('./plugin-helper')
function sendMessage (settings, rec) { function sendMessage (settings, rec) {

View file

@ -212,6 +212,7 @@ function complianceNotify (customer, deviceId, action, period) {
notifyIfActive('compliance', 'customerComplianceNotify', customer, deviceId, action, period) notifyIfActive('compliance', 'customerComplianceNotify', customer, deviceId, action, period)
return Promise.all(promises) 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)) if (webhookActive) promises.push(webhookFuncs.sendMessage(settings, rec))
return Promise.all(promises) 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) notifyIfActive('security', 'cashboxNotify', deviceId)
return Promise.all(promises) 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}`))
}) })
} }