mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
add try catch to pushover node response
This commit is contained in:
@@ -101,8 +101,13 @@ module.exports = function(RED) {
|
||||
pusher.send( pushmsg, function(err, response) {
|
||||
if (err) { node.error(err); }
|
||||
else {
|
||||
response = JSON.parse(response);
|
||||
if (response.status !== 1) { node.error("[57-pushover.js] Error: "+response); }
|
||||
try {
|
||||
response = JSON.parse(response);
|
||||
if (response.status !== 1) { node.error("[57-pushover.js] Error: "+response); }
|
||||
}
|
||||
catch(e) {
|
||||
node.error("[57-pushover.js] Error: "+response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user