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.*"