Skip to content

Instantly share code, notes, and snippets.

@felds
Last active October 3, 2018 05:43
Show Gist options
  • Select an option

  • Save felds/d53069113aa710da9a50 to your computer and use it in GitHub Desktop.

Select an option

Save felds/d53069113aa710da9a50 to your computer and use it in GitHub Desktop.
Error handling in Gulp using `gulp-plumber` and `gulp-notify`
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
const plumber_notifier = plumber({
errorHandler: notify.onError({
title: "Oops!",
message: "<%= error.message %>",
}),
});
// usage
gulp.task('sausage', [], function () {
return gulp.src('pork/*.part')
.pipe(plumber_notifier)
.pipe(make_the_sausage())
.pipe(gulp.dest('fridge/sausagefile.pack'))
;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment