Skip to content

Instantly share code, notes, and snippets.

@Lukas238
Created August 5, 2015 23:25
Show Gist options
  • Save Lukas238/ffc862030381091c67b1 to your computer and use it in GitHub Desktop.
Save Lukas238/ffc862030381091c67b1 to your computer and use it in GitHub Desktop.
gulp-plumber error handling 2
var plumber = require('gulp-plumber'),
notify = require('gulp-notify'),
gutil = require('gulp-util');
var gulp_src = gulp.src;
gulp.src = function() {
return gulp_src.apply(gulp, arguments)
.pipe(plumber(function(error) {
gutil.log(gutil.colors.red(error.plugin + ': ' + error.message));
gutil.log(gutil.colors.yellow('Line '+ error.line+', Column ' + error.column + ' | ' + error.file));
gutil.log(gutil.colors.grey('Path: ' + error.fileName));
gutil.beep();
this.emit('end');
})
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment