From fefcd738e3037d47a0d9803fb006237f9d694b31 Mon Sep 17 00:00:00 2001 From: Adrian Ziemkowski Date: Sun, 21 Jul 2013 18:20:42 -0400 Subject: [PATCH] Printing out exceptions so that CLI users can see the error message and location details --- bin/uglifyjs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/uglifyjs b/bin/uglifyjs index 2611d960..8da3b575 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -244,11 +244,17 @@ async.eachLimit(files, 1, function (file, cb) { }); } else { - TOPLEVEL = UglifyJS.parse(code, { - filename : file, - toplevel : TOPLEVEL, - expression : ARGS.expr, - }); + try { + TOPLEVEL = UglifyJS.parse(code, { + filename : file, + toplevel : TOPLEVEL, + expression : ARGS.expr, + }); + } + catch (ex) { + sys.error("ERROR: " + ex); + process.exit(1); + } }; }); cb();