From b974f4da64d49035edd3e854354a5f1609a69ab1 Mon Sep 17 00:00:00 2001 From: mscdex Date: Mon, 18 Mar 2013 09:54:05 -0400 Subject: [PATCH] listen for 'error' on both plain and cleartext sockets --- lib/imap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/imap.js b/lib/imap.js index 5140a8f..7d43915 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -162,7 +162,7 @@ ImapConnection.prototype.connect = function(loginCb) { self.emit('close', had_error); }); - state.conn.on('error', function(err) { + socket.on('error', function(err) { clearTimeout(state.tmrConn); err.level = 'socket'; if (state.status === STATES.NOCONNECT)