[Pkg-javascript-commits] [ltx] 77/469: connection: error() should emit 'error'

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:04 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 3eb35df682c039b24dc0bd5d409e28bab26d88c9
Author: Astro <astro at spaceboyz.net>
Date:   Sun Sep 5 23:08:41 2010 +0200

    connection: error() should emit 'error'
---
 lib/xmpp/connection.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/xmpp/connection.js b/lib/xmpp/connection.js
index c8da07c..9e350f8 100644
--- a/lib/xmpp/connection.js
+++ b/lib/xmpp/connection.js
@@ -207,12 +207,15 @@ Connection.prototype.end = function() {
 };
 
 /**
- * End connection with stream error
+ * End connection with stream error.
+ * Emits 'error' event too.
  *
  * @param {String} condition XMPP error condition, see RFC3920 4.7.3. Defined Conditions
  * @param {String} text Optional error message
  */
 Connection.prototype.error = function(condition, text) {
+    this.emit('error', new Error(condition));
+
     if (!this.writable)
 	return;
 

-- 
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