From 6d6114a787ef6827e852a86643e9afbf2e1f8e09 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Tue, 29 Nov 2011 21:20:07 -0700 Subject: [PATCH] Add error handler for net connection problems such as invalid server name. --- lib/irc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/irc.js b/lib/irc.js index ed989216..be0471c4 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -549,6 +549,9 @@ Client.prototype.connect = function ( retryCount, callback ) { // {{{ self.connect( retryCount + 1 ); }, self.opt.retryDelay ); }); + self.conn.addListener("error", function(exception) { + self.emit("netError", exception); + }); }; // }}} Client.prototype.disconnect = function ( message, callback ) { // {{{ if ( typeof(message) === 'function' ) {