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

Twitter: add rate limit warning

This commit is contained in:
Nick O'Leary 2014-05-07 20:45:59 +01:00
parent 3c176d0b94
commit e6794a0c75

View File

@ -177,7 +177,11 @@ module.exports = function(RED) {
node.log("tweet rate limit hit"); node.log("tweet rate limit hit");
}); });
stream.on('error', function(tweet,rc) { stream.on('error', function(tweet,rc) {
node.warn(tweet); if (rc == 420) {
node.warn("Twitter rate limit hit");
} else {
node.warn("Stream error:"+tweet.toString()+" ("+rc+")");
}
setTimeout(setupStream,10000); setTimeout(setupStream,10000);
}); });
stream.on('destroy', function (response) { stream.on('destroy', function (response) {