Closed godmar closed 7 years ago
Connection failures (like trying to connecting to an IP/port that's not responding) still crash node: events.js:160 throw er; // Unhandled 'error' event ^
Error: connect ETIMEDOUT 50.250.206.120:389 at Object.exports._errnoException (util.js:1026:11) at exports._exceptionWithHostPort (util.js:1049:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
Also, specifying connectionTimeout: 5 in LdapAuth constructor options results in it apparently never timing out and just hanging there indefinitely, at least on Windows.
Also, specifying connectionTimeout: 5 in LdapAuth constructor options results in it apparently never timing out and just hanging there indefinitely, at least on Windows.
Same result here, a server not responding makes the authenticate method hangs indefinitely, no matter the options
I just had the same issue and after digging a bit I found that I just had to handle error
events manually.
const ldap = new LdapAuth(...);
ldap.on('error', handleLdapError);
ldap.authenticate(...);
This is even mentioned in the example in the README, I just skipped over it 🤷♂
The LDAP server I'm using tends to, for reasons I'm not privy to, reset its connection to my node.js application.
This results in an uncaught error that causes node to exit:
I am using ldapauth-fork as described in issue #38
I understand that the uncaught exception is thrown because there is no listener for the 'error' event - but the event fires on 'Client'. I'd be grateful for any advice as to how to catch this error properly (it occurs every 5-10 mins).
Currently, I am relying on pm2 to restart node.