From 8ec8c3011e9968d408dc5ed00110371c12447472 Mon Sep 17 00:00:00 2001 From: Ben Fletcher Date: Mon, 23 Apr 2018 17:50:55 +0100 Subject: [PATCH] say we've got error for better developer usability We had problems with `npm ls` (deep in `haikro`) earlier today because it didn't output any indication that it had errors/issues. Only a bad return code that we didn't know about, made worse by the fact that it was `--log-leve=silence`. I realise that one reason for this design is for ease of integration & scriptability (string comparison with error output) but hey IMHO a bad error output is far better than a silent error output. :) --- shellpromise.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shellpromise.js b/shellpromise.js index 93aaa81..a4c67db 100644 --- a/shellpromise.js +++ b/shellpromise.js @@ -31,9 +31,7 @@ function shellpromise (processToRun, options) { if (code === 0) { resolve(output); } else { - if (options.verbose) { - console.warn(processToRun + ' exited with exit code ' + code); - } + console.warn(processToRun + ' exited with a non-zero (error) exit code ' + code); reject(new Error(output)); } });