Skip to content

Commit

Permalink
fix: add missing error handler to spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jun 14, 2023
1 parent ca159ec commit 82fe76d
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 82fe76d

Please sign in to comment.