Last active
October 3, 2018 05:43
-
-
Save felds/d53069113aa710da9a50 to your computer and use it in GitHub Desktop.
Error handling in Gulp using `gulp-plumber` and `gulp-notify`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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