Avoid handling all errors now that blocking errors are handled properly

This commit is contained in:
Thomas P 2019-10-12 00:35:19 +02:00
parent eda98986f2
commit c27e14960e
No known key found for this signature in database
GPG Key ID: 722E1405F9F15F5E
1 changed files with 3 additions and 3 deletions

View File

@ -282,13 +282,13 @@ Client.prototype.bind = function bind (name,
controls: controls 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 var self = this
function callbackWrapper (err, ret) { function callbackWrapper (err, ret) {
self.removeListener('error', callbackWrapper) self.removeListener('connectError', callbackWrapper)
callback(err, ret) callback(err, ret)
} }
this.addListener('error', callbackWrapper) this.addListener('connectError', callbackWrapper)
return this._send(req, [errors.LDAP_SUCCESS], null, callbackWrapper, _bypass) return this._send(req, [errors.LDAP_SUCCESS], null, callbackWrapper, _bypass)
} }