From d4d2404578428084a51a1f771a7f6a07e186bd17 Mon Sep 17 00:00:00 2001 From: JsBergbau <37013344+JsBergbau@users.noreply.github.com> Date: Wed, 20 May 2020 13:04:42 +0000 Subject: [PATCH] On error sending pushover message throw a catchable exception (#653) * On error throw a catchable Throws an catchable exception if there is any error in sending the message. So you can react to it with a catch node * Updated errorhandling Updated the error handling process to be in compliance with the Node-RED Api --- social/pushover/57-pushover.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/social/pushover/57-pushover.js b/social/pushover/57-pushover.js index dd020f9e..65a27ca1 100644 --- a/social/pushover/57-pushover.js +++ b/social/pushover/57-pushover.js @@ -91,16 +91,16 @@ module.exports = function(RED) { node.error("[57-pushover.js] Error: attachment property must be a path to a local file or a Buffer containing an image"); return; } - pushMessage(pushmsg); + pushMessage(pushmsg,msg); } else { node.warn("Pushover credentials not set."); } }); - function pushMessage(pushmsg) { + function pushMessage(pushmsg,msg) { pusher.send( pushmsg, function(err, response) { - if (err) { node.error(err); } + if (err) { node.error(err,msg); } else { try { response = JSON.parse(response);