Certain library objects that extend EventEmitter emits error on callback that are not caught by a try/catch or Promise. If it is not possible to address this in code somehow, those objects and methods should be marked in the documentation as requiring an error listener.
IMPACT:
Node.js throws uncaught exception in edge-case situations
Example 1: failing dns request
node--eval"new Promise(r => new (require('http').Server)().listen(0, '#$%'))"events.js:160thrower;// Unhandled 'error' event^
Error: getaddrinfoENOTFOUND #$%aterrnoException(dns.js:28:10)atGetAddrInfoReqWrap.onlookup[asoncomplete](dns.js:79:26)Example 2: failed spawn
node--eval"new Promise(r => require('child_process').spawn('error factory'))"events.js:160thrower;// Unhandled 'error' event^
Error: spawnerrorfactoryENOENTatexports._errnoException(util.js:1026:11)atProcess.ChildProcess._handle.onexit(internal/child_process.js:182:32)atonErrorNT(internal/child_process.js:348:16)at_combinedTickCallback(internal/process/next_tick.js:74:11)atprocess._tickCallback(internal/process/next_tick.js:98:9)uname --all && node --version
Linux c89 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
v6.4.0
Certain library objects that extend EventEmitter emits error on callback that are not caught by a try/catch or Promise. If it is not possible to address this in code somehow, those objects and methods should be marked in the documentation as requiring an error listener.
IMPACT:
Node.js throws uncaught exception in edge-case situations
Example 1: failing dns request
Example 2: failed spawn