Permalink
Browse files

move handleErrors() back to prev pos

  • Loading branch information...
1 parent 4a05aae commit 2c5e9017a8915461e7432376664e6b7ce5851232 @tj committed Oct 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/sockets/sock.js
View
@@ -277,6 +277,8 @@ Socket.prototype.connect = function(port, host, fn){
port = port;
host = host || '127.0.0.1';
+ this.handleErrors(sock);
+
sock.on('close', function(){
self.connected = false;
self.removeSocket(sock);
@@ -296,7 +298,6 @@ Socket.prototype.connect = function(port, host, fn){
debug('connect');
self.connected = true;
self.addSocket(sock);
- self.handleErrors(sock);
self.retry = self.get('retry timeout');
self.emit('connect');
fn && fn();

0 comments on commit 2c5e901

Please sign in to comment.