fix cli error reporting
authoralexlamsl <alexlamsl@gmail.com>
Fri, 5 Feb 2016 19:32:26 +0000 (03:32 +0800)
committeralexlamsl <alexlamsl@gmail.com>
Fri, 5 Feb 2016 19:32:26 +0000 (03:32 +0800)
it was attempting to write the error object onto stderr, which errs out by itself and masked the original error and stack trace

cli.js

diff --git a/cli.js b/cli.js
index a2dd2cc..b4d146d 100755 (executable)
--- a/cli.js
+++ b/cli.js
@@ -168,7 +168,7 @@ cli.main(function(args, options) {
     catch (e) {
       status = 3;
       cli.error('Minification error');
-      process.stderr.write(e);
+      process.stderr.write((e.stack || e).toString());
     }
 
     if (minifyOptions.lint) {