fix: on newer nodejs versions listening to socket errors are required#1089
Conversation
|
From the original code snippet, it is using socket = net.createConnection(config.loggerPort || 5000, config.loggerHost || 'localhost');
Based on
It seems like the behavior did not change and that the @jhonatanTeixeira Would you happen to have any references that newer NodeJS requires listening to socket errors? |
|
Just run it on a newer nodejs and try to connect to a tcp destination like logstash for example and you will see it trhows an error. Newer nodejs require all errors thrown inside a promise to be catched, so that cancels the connection |
|
@jhonatanTeixeira I verified. Good find! It's due to the way If there is no listener to the
|
No description provided.