Skip to content

Errors should emit error event #845

@agarzola

Description

@agarzola

Hi! I am triaging an issue with our builds wherein our main Gulp task produces exit code 0 even if there was an error with the Sass plugin. I believe the issue is here:

gulp-sass/index.js

Lines 174 to 178 in c04bb67

gulpSass.logError = function logError(error) {
const message = new PluginError('sass', error.messageFormatted).toString();
process.stderr.write(`${message}\n`);
this.emit('end');
};

Instead of this.emit('end'), I believe that the recommended solution is to do this.emit('error'). I realize, however, that this may constitute a breaking change, so I think making this change opt-in might be for the best (default is end, and you can opt-in for error).

I will attempt to address this in a fork and submit a pull request for review, if you would be open to that. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions