process: swallow stdout/stderr error events
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
process, console
Description of change
This is a step in making console
safe, swallows EPIPE and other
errors by registering an empty 'error' event listener.
Also fixes writes to stdout/stderr not working after end()
is called,
even though we already override destroy()
so the stream is never
actually closed.
Refs: https://github.com/nodejs/node/issues/831 Fixes: https://github.com/nodejs/node/issues/947 Fixes: https://github.com/nodejs/node/issues/9403
Mentioning some people from issue #831 (closed) "console
should be safe": @vkurchatkin, @benjamingr, @nodejs/streams
(This patch was made live during https://www.twitch.tv/nodesource/v/98991703 if you'd like to see me working on this in retrospect. :P)