scniro/gulp-clean-css

Errors in CleanCSS cause abort with no diagnostics.

paulmer opened this issue · 0 comments

An error processing a CSS file (for example, an @import of a non-existing file) causes gulp-clean-css to abort without any diagnostic message.

According to https://gulpjs.com/docs/en/getting-started/async-completion under "Using an error-first callback", the cb function can be passed an Error object, but gulp-clean-css is passing a string on line 37: return cb(errors.join(' '));. Wrapping the string in an error object fixes the problem: return cb(new Error(errors.join(' ')));.