Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit c27e149

Browse files
committed
Avoid handling all errors now that blocking errors are handled properly
1 parent eda9898 commit c27e149

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/client/client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,13 @@ Client.prototype.bind = function bind (name,
282282
controls: controls
283283
})
284284

285-
// While we are binding to the server, register the callback as error handler
285+
// Connection errors will be reported to the bind callback too (useful when the LDAP server is not available)
286286
var self = this
287287
function callbackWrapper (err, ret) {
288-
self.removeListener('error', callbackWrapper)
288+
self.removeListener('connectError', callbackWrapper)
289289
callback(err, ret)
290290
}
291-
this.addListener('error', callbackWrapper)
291+
this.addListener('connectError', callbackWrapper)
292292

293293
return this._send(req, [errors.LDAP_SUCCESS], null, callbackWrapper, _bypass)
294294
}

0 commit comments

Comments
 (0)