Skip to content

Commit

Permalink
Merge pull request #212 from bryan-m-hughes/timob-14098
Browse files Browse the repository at this point in the history
[TIMOB-14098] Fleshed out error reporting and made it work on node 0.8.x
  • Loading branch information
cb1kenobi committed Jun 5, 2013
2 parents fdf7eb0 + 0ba0dcf commit cfd9cce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/CodeProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ function run(sourceInformation, options, plugins, logger, callback) {
options = options || {};
plugins = plugins || {};

Runtime.setLogger(logger);

try {
Runtime.setLogger(logger);

init(sourceInformation, options, plugins);

Runtime.on('enteredFile', function(e) {
Expand All @@ -282,8 +282,12 @@ function run(sourceInformation, options, plugins, logger, callback) {
}

finalize();

Runtime.log('info', 'Generating results');
Runtime.fireEvent('projectProcessingEnd', 'Project processing complete');
generateResultsPages(options.outputFormat, Runtime.options.resultsPath, Runtime.options.resultsTheme, callback);
} catch(e) {
if (e instanceof RangeError && e.message === 'Maximum call stack size exceeded') {
if (e.message === 'Maximum call stack size exceeded') {
console.error('node.js maximum call stack size exceeded. Increasing the stack size may allow the project to be fully analyzed');
} else {
console.error('Internal error ' + e.message + '. Please file a bug report at http://jira.appcelerator.org/');
Expand All @@ -293,10 +297,6 @@ function run(sourceInformation, options, plugins, logger, callback) {
}
}

Runtime.log('info', 'Generating results');
Runtime.fireEvent('projectProcessingEnd', 'Project processing complete');
generateResultsPages(options.outputFormat, Runtime.options.resultsPath, Runtime.options.resultsTheme, callback);

return results;
}

Expand Down

0 comments on commit cfd9cce

Please sign in to comment.