Skip to content

Commit

Permalink
Making --no-color actually work for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed May 2, 2012
1 parent e77d4b6 commit 05b6611
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ var YUI = require('yui').YUI,


process.on('uncaughtException', function(msg) {
var Y = YUI(),
var inst = YUI(),
meta = JSON.parse(fs.readFileSync(metaPath));

Y.applyConfig({ debug: true });
Y.log('--------------------------------------------------------------------------', 'error');
Y.log('An uncaught YUIDoc error has occurred, stack trace given below', 'error');
Y.log('--------------------------------------------------------------------------', 'error');
Y.log(msg.stack || msg.message, 'error');
Y.log('--------------------------------------------------------------------------', 'error');
Y.log('Node.js version: ' + process.version, 'error');
Y.log('YUI version: ' + YUI.version, 'error');
Y.log('YUIDoc version: ' + meta.version, 'error');
Y.log('Please file all tickets here: ' + meta.bugs.url, 'error');
Y.log('--------------------------------------------------------------------------', 'error');

inst.applyConfig({
debug: true,
useColor: Y.config.useColor
});
inst.log('--------------------------------------------------------------------------', 'error');
inst.log('An uncaught YUIDoc error has occurred, stack trace given below', 'error');
inst.log('--------------------------------------------------------------------------', 'error');
inst.log(msg.stack || msg.message, 'error');
inst.log('--------------------------------------------------------------------------', 'error');
inst.log('Node.js version: ' + process.version, 'error');
inst.log('YUI version: ' + YUI.version, 'error');
inst.log('YUIDoc version: ' + meta.version, 'error');
inst.log('Please file all tickets here: ' + meta.bugs.url, 'error');
inst.log('--------------------------------------------------------------------------', 'error');

process.exit(1);
});
Expand Down

0 comments on commit 05b6611

Please sign in to comment.