add relativePath property to error object in order to play nicely with gulp-notify

This commit is contained in:
Aaron Schloser 2015-12-18 10:35:52 -08:00
parent d62227fb9d
commit b3fe81f86a
2 changed files with 3 additions and 0 deletions

View file

@ -127,6 +127,8 @@ var gulpSass = function gulpSass(options, sync) {
error.messageFormatted = message;
error.message = gutil.colors.stripColor(message);
error.relativePath = relativePath;
return cb(new gutil.PluginError(
PLUGIN_NAME, error
));

View file

@ -379,6 +379,7 @@ describe('gulp-sass -- sync compile', function() {
stream.on('error', function(err) {
err.message.indexOf('property "font" must be followed by a \':\'').should.not.equal(-1);
err.relativePath.should.equal('test/scss/error.scss');
done();
});
stream.write(errorFile);