fix: Log errors when sending notifications via Apprise

This commit is contained in:
Maksim Eltyshev
2025-11-19 18:19:31 +01:00
parent 015562d8da
commit cd5685049e
3 changed files with 39 additions and 16 deletions

View File

@@ -25,11 +25,15 @@ module.exports = {
},
async fn(inputs) {
return promisifyExecFile(`${sails.config.appPath}/.venv/bin/python3`, [
`${sails.config.appPath}/utils/send_notifications.py`,
JSON.stringify(inputs.services),
inputs.title,
JSON.stringify(inputs.bodyByFormat),
]);
try {
await promisifyExecFile(`${sails.config.appPath}/.venv/bin/python3`, [
`${sails.config.appPath}/utils/send_notifications.py`,
JSON.stringify(inputs.services),
inputs.title,
JSON.stringify(inputs.bodyByFormat),
]);
} catch (error) {
sails.log.error(`Error sending notifications: ${error.stderr || error.message}`);
}
},
};