From c27e14960e71e647675ff9a05f4b3236aa9ba1e9 Mon Sep 17 00:00:00 2001 From: Thomas P Date: Sat, 12 Oct 2019 00:35:19 +0200 Subject: [PATCH] Avoid handling all errors now that blocking errors are handled properly --- lib/client/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client/client.js b/lib/client/client.js index d111ec2..80e3505 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -282,13 +282,13 @@ Client.prototype.bind = function bind (name, controls: controls }) - // While we are binding to the server, register the callback as error handler + // Connection errors will be reported to the bind callback too (useful when the LDAP server is not available) var self = this function callbackWrapper (err, ret) { - self.removeListener('error', callbackWrapper) + self.removeListener('connectError', callbackWrapper) callback(err, ret) } - this.addListener('error', callbackWrapper) + this.addListener('connectError', callbackWrapper) return this._send(req, [errors.LDAP_SUCCESS], null, callbackWrapper, _bypass) }