Skip to content

Commit

Permalink
fix: do not throw if child process no longer exist (#108)
Browse files Browse the repository at this point in the history
fix: do not throw if child process no longer exist
  • Loading branch information
mucsi96 authored and bahmutov committed Oct 23, 2018
1 parent 3d21c83 commit c623c62
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ function startAndTest ({ start, url, test }) {
.then(children => {
debug('stopping child processes')
children.forEach(child => {
process.kill(child.PID)
try {
process.kill(child.PID)
} catch (e) {
if (e.code === 'ESRCH') {
console.log(`Child process ${child.PID} exited before trying to stop it`)
} else {
throw e
}
}
})
})
.then(() => {
Expand Down

0 comments on commit c623c62

Please sign in to comment.