From e6794a0c75e336d14cc414399ee6a04ba4da3fc8 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 7 May 2014 20:45:59 +0100 Subject: [PATCH] Twitter: add rate limit warning --- nodes/core/social/27-twitter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nodes/core/social/27-twitter.js b/nodes/core/social/27-twitter.js index fe3a60a4a..d287ba473 100644 --- a/nodes/core/social/27-twitter.js +++ b/nodes/core/social/27-twitter.js @@ -177,7 +177,11 @@ module.exports = function(RED) { node.log("tweet rate limit hit"); }); 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); }); stream.on('destroy', function (response) {