mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
add try catch to pushover node response
This commit is contained in:
parent
1f0aa6908c
commit
876c9a014e
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-pushover",
|
||||
"version" : "0.0.15",
|
||||
"version" : "0.0.16",
|
||||
"description" : "A Node-RED node to send alerts via Pushover",
|
||||
"dependencies" : {
|
||||
"pushover-notifications" : "^1.2.0"
|
||||
|
Loading…
Reference in New Issue
Block a user