plumber = require('gulp-plumber'); var notify = require('gulp-notify'); exports.createGulpTask = function (subDir, taskName) { return function(){ gulp.src(INPUT_ROOT_DIR + subDir + taskName + '.scss') .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) .pipe(compass({ config_file: INPUT_ROOT_DIR + 'config.rb', comments: false, css: OUTPUT_ROOT_DIR, sass: INPUT_ROOT_DIR })); } }