From fb4b39e75bdbbe551b9f47b521c953b8c6728686 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 1 Nov 2015 07:21:17 -0500 Subject: [PATCH] Tweaking error handling setup --- gulpfile.js | 15 ++++----------- package.json | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 873fc71..fbd99af 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,15 +1,8 @@ var gulp = require('gulp'), _ = require('lodash'), notify = require('gulp-notify'), - plumber = require('gulp-plumber'), config = require('./config'); -function errorHandler() { - return plumber({ - errorHandler: notify.onError('Error: <%= error.message %>') - }); -} - gulp.task('default', ['server', 'docs'], function() { gulp.watch(config.globs.other, ['static']); gulp.watch(_.flatten([ @@ -55,7 +48,6 @@ gulp.task('build', ['static', 'markup', 'styles', 'scripts']); gulp.task('static', function() { return gulp.src(config.globs.other, { base: './src' }) - .pipe(errorHandler()) .pipe(gulp.dest(config.buildRoot)); }); @@ -65,7 +57,6 @@ gulp.task('markup', ['styles'], function() { rename = require('gulp-rename'); return gulp.src(config.globs.templates) - .pipe(errorHandler()) .pipe(frontMatter()) .pipe(hb({ data: config.globs.data, @@ -73,6 +64,7 @@ gulp.task('markup', ['styles'], function() { partials: config.globs.partials, bustCache: true, })) + .on('error', notify.onError()) .pipe(rename(function(path) { path.extname = '.html'; })) @@ -85,16 +77,16 @@ gulp.task('styles', function() { rename = require('gulp-rename'); return gulp.src(config.globs.sass) - .pipe(errorHandler()) .pipe(sourcemaps.init()) .pipe(sass({ includePaths: require('node-bourbon').includePaths })) + .on('error', notify.onError()) .pipe(rename(function(path) { path.dirname = ''; })) .pipe(sourcemaps.write('.')) - .pipe(gulp.dest(config.buildPath('css'))); + .pipe(gulp.dest(config.buildPath('css'))) }); gulp.task('scripts', function() { @@ -110,6 +102,7 @@ gulp.task('scripts', function() { .add('./src/js/main.js'); return b.bundle() + .on('error', notify.onError()) .pipe(source('./src/js/main.js')) .pipe(buffer()) .pipe(sourcemaps.init({ loadMaps: true })) diff --git a/package.json b/package.json index a206626..5f62269 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "gulp-front-matter": "^1.3.0", "gulp-hb": "^2.6.5", "gulp-notify": "^2.0.1", - "gulp-plumber": "^1.0.0", "gulp-rename": "^1.2.2", "gulp-sass": "^2.1.0", "gulp-sourcemaps": "^1.6.0",