nikhilmodak / gulp-ngdocs

Gulp plugin for building angularJS documentation
MIT License
95 stars 64 forks source link

error break the watcher even with gulp-plumber #92

Open toutpt opened 8 years ago

toutpt commented 8 years ago

Here is my gulp task, that is launched by a watcher.

My problem is when an error occured even plumber can not notify me from the error, the process quit, so I need to check my console every time.

Is this a bug or did I miss something ?

'use strict';
/*jshint node:true */
var config = require('./config');
var gulp = require('gulp');
var gulpDocs = require('gulp-ngdocs');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');

gulp.task('docs', [], function () {
    var options = {
        scripts: ['../app.min.js'],
        html5Mode: false,
        startPage: '/api',
        title: "Swif Docs",
        titleLink: "/api"
    }
    return gulp.src('src/**/*.js')
        .pipe(plumber())
        .pipe(gulpDocs.process(options))
        .pipe(gulp.dest('./docs'));
});

but when an error occurred, the process quit:

[15:11:20] Starting 'docs'...
...node_modules/gulp-ngdocs/src/ngdoc.js:437
            throw new Error("Not a valid 'returns' format: " + text + ' (found in: ' + self.file + ':' + self.line + ')');
            ^

Error: Not a valid 'returns' format: {Array<Object>} (found in: ...src/framework/data.js:455)
    at flush (...node_modules/gulp-ngdocs/src/ngdoc.js:437:19)
    at Object.Doc.parse (...node_modules/gulp-ngdocs/src/ngdoc.js:394:5)
    at ...node_modules/gulp-ngdocs/src/reader.js:49:99
    at Array.forEach (native)
    at processJsFile (...node_modules/gulp-ngdocs/src/reader.js:34:9)
    at Object.process (...node_modules/gulp-ngdocs/src/reader.js:17:5)
    at DestroyableTransform.transformFunction [as _transform] (...node_modules/gulp-ngdocs/index.js:204:14)
    at DestroyableTransform.Transform._read (...node_modules/gulp-ngdocs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (...node_modules/gulp-ngdocs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (...node_modules/gulp-ngdocs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
jongunter commented 8 years ago

I'm having the same issue: I found more here https://github.com/floatdrop/gulp-plumber/issues/33 Haven't been able to find a solution yet.