Skip to content

Commit

Permalink
chore(doc-gen): improve error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Mar 7, 2014
1 parent c5f2f58 commit 486f1b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 3 additions & 6 deletions docs/config/processors/pages-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions docs/docs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 5 additions & 1 deletion docs/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 486f1b4

Please sign in to comment.