sindresorhus / nano-spawn

Tiny process execution for humans — a better child_process
MIT License
437 stars 6 forks source link

Improve stream error handling #49

Closed ehmicky closed 2 months ago

ehmicky commented 2 months ago

This PR refactors the stream error handling logic.

Since the close event waits for stdin/stdout/stderr to be closed, we do not need to await them. Also, we were not listening for errors on stdin. We now are. Also, this handles some specific error types which are piping-related better (will be better tested in the subprocess.pipe() PR, which is coming next). Finally, this adds a few more tests.