From: alexlamsl Date: Fri, 5 Feb 2016 19:32:26 +0000 (+0800) Subject: fix cli error reporting X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3d9d2e4bf8a287f7adabed774034ea56e58a46ab;p=html-minifier.git fix cli error reporting it was attempting to write the error object onto stderr, which errs out by itself and masked the original error and stack trace --- diff --git a/cli.js b/cli.js index a2dd2cc..b4d146d 100755 --- 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) {