From 82fe76d7129d5f92600d27fb74e3e7389da825b4 Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Wed, 14 Jun 2023 23:08:07 +0100 Subject: [PATCH] fix: add missing error handler to spawn --- lib/find_process.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/find_process.js b/lib/find_process.js index fc18182..6acc8d7 100644 --- a/lib/find_process.js +++ b/lib/find_process.js @@ -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))