diff options
| author | Peter Bacon Darwin | 2014-03-07 05:33:21 +0000 | 
|---|---|---|
| committer | Peter Bacon Darwin | 2014-03-07 10:41:48 +0000 | 
| commit | 486f1b4e5117584824ed67ebea7572cf13f09d72 (patch) | |
| tree | 3b0fdad333028c36e7f6fd9681603bd88df41148 | |
| parent | c5f2f583ab24f359041b3babf2655f98e40b6c5b (diff) | |
| download | angular.js-486f1b4e5117584824ed67ebea7572cf13f09d72.tar.bz2 | |
chore(doc-gen): improve error reporting
| -rw-r--r-- | docs/config/processors/pages-data.js | 9 | ||||
| -rw-r--r-- | docs/docs.config.js | 2 | ||||
| -rw-r--r-- | docs/gulpfile.js | 6 | 
3 files changed, 10 insertions, 7 deletions
| diff --git a/docs/config/processors/pages-data.js b/docs/config/processors/pages-data.js index 43fdc9dd..1b93b021 100644 --- a/docs/config/processors/pages-data.js +++ b/docs/config/processors/pages-data.js @@ -145,6 +145,9 @@ module.exports = {      _(docs)      .filter(function(doc) { return doc.area === 'api'; })      .filter(function(doc) { return doc.docType === 'module'; }) +    .forEach(function(doc) { if ( !doc.path ) { +      log.warn('Missing path property for ', doc.id); +    }})      .map(function(doc) { return _.pick(doc, ['id', 'module', 'docType', 'area']); })      .tap(function(docs) {        log.debug(docs); @@ -188,12 +191,6 @@ module.exports = {          area.navGroups = navGroupMapper(pages, area);        }); -    _.forEach(docs, function(doc) { -      if ( !doc.path ) { -        log.warn('Missing path property for ', doc.id); -      } -    }); -      // Extract a list of basic page information for mapping paths to paritals and for client side searching      var pages = _(docs)        .map(function(doc) { diff --git a/docs/docs.config.js b/docs/docs.config.js index c1539cb6..62fd6066 100644 --- a/docs/docs.config.js +++ b/docs/docs.config.js @@ -25,6 +25,8 @@ module.exports = function(config) {      { pattern: '**/*.ngdoc', basePath: path.resolve(basePath, 'content') }    ]); +  config.set('processing.stopOnError', true); +    config.set('processing.errors.minerrInfoPath', path.resolve(basePath, '../build/errors.json'));    config.set('rendering.outputFolder', '../build/docs'); diff --git a/docs/gulpfile.js b/docs/gulpfile.js index caef1a89..c47c04f5 100644 --- a/docs/gulpfile.js +++ b/docs/gulpfile.js @@ -49,7 +49,11 @@ gulp.task('assets', ['bower'], function() {  gulp.task('doc-gen', function() { -  return docGenerator('docs.config.js').generateDocs(); +  return docGenerator('docs.config.js') +    .generateDocs() +    .catch(function(error) { +      process.exit(1); +    });  });  // JSHint the example and protractor test files | 
