Skip to content

Commit

Permalink
Merge pull request #64 from Julusian/fix/spawn-error-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
yibn2008 authored Oct 19, 2023
2 parents ca159ec + 82fe76d commit 454c49e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/find_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ const finders = {
proc.stdout.on('data', data => {
lines.push(data.toString())
})
proc.on('error', err => {
reject(new Error('Command \'' + cmd + '\' failed with reason: ' + err.toString()))
})
proc.on('close', code => {
if (code !== 0) {
return reject(new Error('Command \'' + cmd + '\' terminated with code: ' + code))
Expand Down

0 comments on commit 454c49e

Please sign in to comment.