gulp-combine-media-queries
gulp-combine-media-queries copied to clipboard
Error not catched in css-parse
When css-parse encounters an error it throws a new Error object which is not caught in index,js:125
This causes the watch workflow in Gulp to crash due to an unhandled error and is also resulting the .on('error') event not to be triggered.
Please look at some options to catch the error and throw a PluginError instead?
@tkjaergaard Hi.
I do not know well how to receive the error css-parse can throw.
https://github.com/reworkcss/css-parse#errors
I do think I think we can deal with such a situation to add code similar to the following, but do you intent not match the thing you are you said?
var cssJson = parseCss(source);
try {
file.contents = new Buffer(cssJson);
} catch (err) {
this.emit('error', new PluginError(PLUGIN_NAME, err));
}
That could be a valid solution to overcome this issue?
Since try if the problem can be solved, why not tell me the CSS code that has a problem css-parse such that an error?
Sorry mate, but what you just wrote doesn't make any sense to me? :)
Hi, i just encountered a similar issue. but the error message in the terminal give me the line where it crash. In fact the parser crash in my case, with a missing ';' at the end of the class declaration.this can be considered as correct in a css validation normaly.
.thumbnails li.thumbnail {
display: block;
padding: 0.3125em;
margin-bottom: 1.2em;
line-height: 23px;
background-color: white;
border: 1px solid silver;
border-radius: 5px
}