Error handling: Throw complete sass error but extend message

release/2.0.1
Thomas Jaggi 2015-05-12 18:48:07 +02:00
parent fc8695a4ca
commit 62af7d477a
1 changed files with 5 additions and 2 deletions

View File

@ -100,8 +100,11 @@ var gulpSass = function gulpSass(options, sync) {
message += gutil.colors.gray(' ' + error.line + ':' + error.column) + ' ';
message += error.message;
error.messageFormatted = message;
error.message = gutil.colors.stripColor(message);
return cb(new gutil.PluginError(
PLUGIN_NAME, message
PLUGIN_NAME, error
));
};
@ -145,7 +148,7 @@ gulpSass.sync = function sync(options) {
// Log errors nicely
//////////////////////////////
gulpSass.logError = function logError(error) {
gutil.log(gutil.colors.red('[' + PLUGIN_NAME + '] ') + error.message);
gutil.log(gutil.colors.red('[' + PLUGIN_NAME + '] ') + error.messageFormatted);
};
//////////////////////////////