diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-09 16:36:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 16:36:44 +0800 |
commit | c14e2805859a3d85788af5d694fca73a6782530e (patch) | |
tree | bf783f0114c5c8b7908f5c3599b9f6fcba39f060 /bin | |
parent | bc3fa78e8cedfda4cc0eb7aa7bc7b00c5e860650 (diff) | |
download | tracifyjs-c14e2805859a3d85788af5d694fca73a6782530e.tar.gz tracifyjs-c14e2805859a3d85788af5d694fca73a6782530e.zip |
print error stack in CLI (#1890)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/uglifyjs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/uglifyjs b/bin/uglifyjs index 8bb8e700..d75b0ee1 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -193,7 +193,7 @@ function run() { } } } catch (ex) { - fatal("ERROR: " + ex.message); + fatal(ex.stack); } var result = UglifyJS.minify(files, options); if (result.error) { @@ -220,7 +220,7 @@ function run() { console.error("Supported options:"); console.error(ex.defs); } - fatal("ERROR: " + ex.message); + fatal(ex.stack); } else if (program.output == "ast") { console.log(JSON.stringify(result.ast, function(key, value) { if (skip_key(key)) return; @@ -263,7 +263,7 @@ function run() { } function fatal(message) { - console.error(message); + console.error(message.replace(/^\S*?Error:/, "ERROR:")); process.exit(1); } @@ -303,7 +303,7 @@ function read_file(path, default_value) { return fs.readFileSync(path, "utf8"); } catch (ex) { if (ex.code == "ENOENT" && default_value != null) return default_value; - fatal("ERROR: " + ex.message); + fatal(ex.stack); } } |