From fcf3e3ad3aaab11e762846dce005381be82ee20c Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 1 Jul 2022 10:33:00 -0700 Subject: [PATCH] Improved error message for if Rust compilation fails. Say, if you accidentally launched two processes simultaneously... --- plugin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin.js b/plugin.js index df1597d..10278cf 100644 --- a/plugin.js +++ b/plugin.js @@ -233,11 +233,15 @@ function runProcess(bin, args, options) { if (code === 0) { resolve() } else { + error(`❌ Rust compilation process failed with exit code ${code}:\n${bin} ${args.join(' ')}\n with ${JSON.stringify(options, '\t')}`) reject(new Error('Rust compilation.')) } }) - p.on('error', reject) + p.on('error', (err) => { + error(`❌ Rust compilation process failed to run with ${err}:\n${bin} ${args.join(' ')}\n with ${JSON.stringify(options, '\t')}`) + reject(err) + }) }) }