Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add relativePath property to error object for notification(s) support #417

Merged
merged 2 commits into from
Dec 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
));
Expand Down
3 changes: 3 additions & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ describe('gulp-sass -- async compile', function() {
err.message.indexOf('test/scss/error.scss').should.not.equal(-1);
// Error must include line and column error occurs on
err.message.indexOf('on line 2').should.not.equal(-1);
// Error must include relativePath property
err.relativePath.should.equal('test/scss/error.scss');
done();
});
stream.write(errorFile);
Expand Down Expand Up @@ -379,6 +381,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);
Expand Down