diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 39e542fb6c..93171bc757 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts @@ -161,7 +161,7 @@ export async function startCargoWatch( ): Promise { const execPromise = util.promisify(child_process.exec); - const { stderr } = await execPromise('cargo watch --version').catch(e => e); + const { stderr, code = 0 } = await execPromise('cargo watch --version').catch(e => e); if (stderr.includes('no such subcommand: `watch`')) { const msg = @@ -201,9 +201,9 @@ export async function startCargoWatch( ); return; } - } else if (stderr !== '') { + } else if (code !== 0) { vscode.window.showErrorMessage( - `Couldn't run \`cargo watch\`: ${stderr}` + `\`cargo watch\` failed with ${code}: ${stderr}` ); return; }