From d229908b8bc441330eeb944eee1623a05579e73a Mon Sep 17 00:00:00 2001 From: Norkevicius Date: Thu, 24 Mar 2022 16:11:50 +0100 Subject: [PATCH] it is not e.errno. It must be e.code the errors logged look like this. LDAP connection error: Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) { errno: -4077, code: 'ECONNRESET', syscall: 'read' } LDAP connection error: Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' } --- lib/LdapLookup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/LdapLookup.js b/lib/LdapLookup.js index f31a727..26b8daa 100644 --- a/lib/LdapLookup.js +++ b/lib/LdapLookup.js @@ -21,7 +21,7 @@ var LdapLookup = module.exports = function(options){ this._client.on('error', function(e){ // Suppress logging of ECONNRESET if ldapjs's Client will automatically reconnect. - if (e.errno === 'ECONNRESET' && self._client.reconnect) return; + if (e.code === 'ECONNRESET' && self._client.reconnect) return; console.log('LDAP connection error:', e); });