gulp-bundle-assets icon indicating copy to clipboard operation
gulp-bundle-assets copied to clipboard

How to catch watch stream errors?

Open sawyerh opened this issue 9 years ago • 1 comments

Forgive me if this is a noob question, I'm a little new when it comes to Gulp. I'm wondering if it's possible to catch errors that happen during a watch. I'm able to do this successfully like this:

gulp.src(config.src)
    .pipe(bundle())
    .on('error', handleErrors)
    ...

However, I'm not quite sure how to do it here:

bundle.watch({
    configPath: path.join(__dirname, '../bundle.config.js'),
    dest: path.join(__dirname, '../../public/assets')
});

sawyerh avatar May 06 '15 16:05 sawyerh

Unfortunately that's not currently possible. An api enhancement would be necessary to bundle.watch to add an onError handler, similar to the change proposed in this issue.

I accept PRs, otherwise I'll try to get to it when I have time.

chmontgomery avatar May 06 '15 20:05 chmontgomery