From b443e85e4415bb041cdab181b1b9adf7113977f1 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 29 Jan 2016 18:06:42 +0000 Subject: [PATCH] XMPP node - missed error tidy on other node --- social/xmpp/92-xmpp.js | 11 +++++++++-- social/xmpp/package.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/social/xmpp/92-xmpp.js b/social/xmpp/92-xmpp.js index cdeae703..7281e6fc 100644 --- a/social/xmpp/92-xmpp.js +++ b/social/xmpp/92-xmpp.js @@ -163,7 +163,15 @@ module.exports = function(RED) { }); xmpp.on('error', function(err) { - node.error(err.stanza.name,err); + if (RED.settings.verbose) { node.log(err); } + if (err.hasOwnProperty("stanza")) { + if (err.stanza.name === 'stream:error') { node.error("stream:error - bad login id/pwd ?",err); } + else { node.error(err.stanza.name,err); } + } + else { + if (err.errno === "ETIMEDOUT") { node.error("Timeout connecting to server",err); } + else { node.error(err.errno,err); } + } node.status({fill:"red",shape:"ring",text:"error"}); }); @@ -225,5 +233,4 @@ module.exports = function(RED) { }); } RED.nodes.registerType("xmpp out",XmppOutNode); - } diff --git a/social/xmpp/package.json b/social/xmpp/package.json index ee7cd840..c363949f 100644 --- a/social/xmpp/package.json +++ b/social/xmpp/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-xmpp", - "version" : "0.1.1", + "version" : "0.1.2", "description" : "A Node-RED node to talk to an XMPP server", "dependencies" : { "simple-xmpp" : "1.3.*"