1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix tweet post error reporting.

This commit is contained in:
Mark Hindess 2014-10-30 08:38:49 +00:00
parent aff8a7802a
commit f06b52625f

View File

@ -264,8 +264,8 @@ module.exports = function(RED) {
node.status({fill:"red",shape:"ring",text:"failed"}); node.status({fill:"red",shape:"ring",text:"failed"});
} else { } else {
var response = JSON.parse(body); var response = JSON.parse(body);
if (body.errors) { if (response.errors) {
var errorList = body.errors.map(function(er) { return er.code+": "+er.message }).join(", "); var errorList = response.errors.map(function(er) { return er.code+": "+er.message }).join(", ");
node.error("tweet failed: "+errorList); node.error("tweet failed: "+errorList);
node.status({fill:"red",shape:"ring",text:"failed"}); node.status({fill:"red",shape:"ring",text:"failed"});
} else { } else {