[Pkg-javascript-commits] [ltx] 24/469: client: emit 'error' on no available sasl mech; examples/send_message: print errors

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:00:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 50119d4f63008a63b492603b16a9f733054e5311
Author: Astro <astro at spaceboyz.net>
Date:   Sun May 30 23:08:54 2010 +0200

    client: emit 'error' on no available sasl mech; examples/send_message: print errors
---
 examples/send_message.js | 5 +++++
 lib/xmpp/client.js       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/send_message.js b/examples/send_message.js
index eff822c..c5912e2 100644
--- a/examples/send_message.js
+++ b/examples/send_message.js
@@ -27,6 +27,11 @@ cl.addListener('authFail',
 		   sys.puts("Authentication failure");
 		   process.exit(1);
 	       });
+cl.addListener('error',
+	       function(e) {
+		   sys.puts("e");
+		   process.exit(1);
+	       });
 cl.addListener('end',
 	       function() {
 		   /* node.js will exit by itself */
diff --git a/lib/xmpp/client.js b/lib/xmpp/client.js
index d1ff14e..2cb2e70 100644
--- a/lib/xmpp/client.js
+++ b/lib/xmpp/client.js
@@ -149,7 +149,7 @@ Client.prototype.useFeatures = function() {
 					mechanism: mech.name
 				      }).t(b64.encode(mech.auth())));
 	} else {
-	    this.emit('authFail');
+	    this.emit('error', 'No usable SASL mechanism');
 	    this.end();
 	}
     } else if (this.state == STATE_AUTHED &&

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list