catch EPIPE errors (#2011)

fixes #1841
This commit is contained in:
Brian Mann
2018-06-21 18:29:27 -04:00
committed by GitHub
parent ace7e97675
commit df0ec8ea8c
2 changed files with 50 additions and 0 deletions
+14
View File
@@ -108,6 +108,20 @@ module.exports = {
process.stderr.write(data)
})
// https://github.com/cypress-io/cypress/issues/1841
// In some versions of node, it will throw on windows
// when you close the parent process after piping
// into the child process. unpiping does not seem
// to have any effect. so we're just catching the
// error here and not doing anything.
process.stdin.on('error', (err) => {
if (err.code === 'EPIPE') {
return
}
throw err
})
if (options.detached) {
child.unref()
}