# How to ensure gulp-sass fails gracefully in 8.5.0?

**URL:** https://discourse.roots.io/t/how-to-ensure-gulp-sass-fails-gracefully-in-8-5-0/8214
**Category:** sage
**Tags:** gulp
**Created:** 2016-11-29T06:46:55Z
**Posts:** 8
**Showing post:** 8 of 8

## Post 8 by @epiphron — 2016-12-01T10:11:11Z

Thanks, @pconnors, I updated the styles task to include `.pipe(plumber({errorHandler: onError}))` and it’s not crashing now.

```
gulp.task('styles', ['wiredep'], function () {
var merged = merge();
manifest.forEachDependency('css', function (dep) {
    var cssTasksInstance = cssTasks(dep.name);
    if (!enabled.failStyleTask) {
        cssTasksInstance.on('error', function (err) {
            console.error(err.message);
            this.emit('end');
        });
    }
    merged.add(gulp.src(dep.globs, {base: 'styles'})
        .pipe(plumber({errorHandler: onError}))
        .pipe(cssTasksInstance));
});
return merged
    .pipe(writeToManifest('styles'));
});

var onError = function (err) {
console.log(err.toString());
this.emit('end');
};
```

---

_[View the full topic](https://discourse.roots.io/t/how-to-ensure-gulp-sass-fails-gracefully-in-8-5-0/8214)._
