chore(doc-gen): improve error reporting

This commit is contained in:
Peter Bacon Darwin
2014-03-07 05:33:21 +00:00
parent c5f2f583ab
commit 486f1b4e51
3 changed files with 10 additions and 7 deletions

View File

@@ -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) {

View File

@@ -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');

View File

@@ -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