NeowayLabs/nw-gulp-tasks — pull request #1 by tiago4orion (2014-12-16 14:09:50+00:00)
Title: [CHANGE] Attach uglify log errors to console.error

UglifyJS in the scripts task isn't catching errors.

```
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error
at new JS_Parse_Error (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:189:18)
```

For now:

```
{ [Error: /home/i4k/projects/neoway/layer-manager/build/js/layer-manager.js: Unexpected token name «fa», expected punc «,»]
message: '/home/i4k/projects/neoway/layer-manager/build/js/layer-manager.js: Unexpected token name «fa», expected punc «,»',
fileName: '/home/i4k/projects/neoway/layer-manager/build/js/layer-manager.js',
lineNumber: 174,
stack: 'Error\n at new JS_Parse_Error (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:189:18)\n at js_error (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:197:11)\n at croak (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:656:9)\n at token_error (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:664:9)\n at expect_token (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:677:9)\n at expect (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:680:36)\n at /home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:1195:44\n at /home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:703:24\n at expr_atom (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:1152:35)\n at maybe_unary (/home/i4k/projects/neoway/layer-manager/node_modules/gulp-uglify/node_modules/uglify-js/lib/parse.js:1327:19)',
showStack: false,
showProperties: true,
plugin: 'gulp-uglify' }
```

We can use gulp-util too.

Thanks!