mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
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
This commit is contained in:
parent
05a9312905
commit
d4d2404578
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user