We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81039ea commit e2252f7Copy full SHA for e2252f7
social/twitter/27-twitter.js
@@ -642,7 +642,13 @@ module.exports = function(RED) {
642
node.status({});
643
} else {
644
node.status({fill:"red",shape:"ring",text:"twitter.status.failed"});
645
- node.error(result.body.errors[0].message,msg);
+ if (result.body.errors && result.body.errors[0] && result.body.errors[0].message) {
646
+ node.error(result.body.errors[0].message,msg);
647
+ } else if (result.body.error) {
648
+ node.error(result.body.error,msg);
649
+ } else {
650
+ node.error("Twitter gave status: "+result.status+", unexpected body: "+JSON.stringify(result.body),msg);
651
+ }
652
}
653
}).catch(function(err) {
654
0 commit comments