aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/child_process.exports.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bun.js/child_process.exports.js b/src/bun.js/child_process.exports.js
index 7af8bdebd..71d97366a 100644
--- a/src/bun.js/child_process.exports.js
+++ b/src/bun.js/child_process.exports.js
@@ -290,7 +290,9 @@ export function execFile(file, args, options, callback) {
if (args?.length) cmd += ` ${ArrayPrototypeJoin.call(args, " ")}`;
if (!ex) {
- ex = genericNodeError(`Command failed: ${cmd}\n${stderr}`, {
+ let message = `Command failed: ${cmd}`;
+ if (stderr) message += `\n${stderr}`;
+ ex = genericNodeError(message, {
// code: code < 0 ? getSystemErrorName(code) : code, // TODO: Add getSystemErrorName
code: code,
killed: child.killed || killed,