node-red-contrib-ifttt
Advanced tools
Comparing version 0.0.13 to 0.1.0
@@ -33,4 +33,10 @@ var request = require('request'); | ||
} else { | ||
var errorMessage; | ||
try { | ||
errorMessage = (JSON.parse(body).hasOwnProperty('errors')) ? JSON.parse(body).errors[0].message : JSON.parse(body); | ||
} catch (e) { | ||
errorMessage = (body.hasOwnProperty('errors')) ? body.errors[0].message : body; | ||
} | ||
node.status({fill: 'red', shape: 'dot', text: 'Error!'}); | ||
node.error(JSON.parse(body).errors[0].message); | ||
node.error(errorMessage); | ||
} | ||
@@ -37,0 +43,0 @@ setTimeout(function () { |
{ | ||
"name": "node-red-contrib-ifttt", | ||
"version": "0.0.13", | ||
"version": "0.1.0", | ||
"description": "A node-red node to connect to ifttt Maker channel", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/diegopamio/node-red-ifttt", |
13182
46