catch fatal parsing errors
This commit is contained in:
parent
02989edb05
commit
95a24cd29b
|
@ -80,9 +80,13 @@ function parseMozFormat({code, styleId}) {
|
||||||
errors.push(`${e.line}:${e.col} ${e.message.replace(/ at line \d.+$/, '')}`);
|
errors.push(`${e.line}:${e.col} ${e.message.replace(/ at line \d.+$/, '')}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
parser.parse(mozStyle, {
|
parser.parse(mozStyle, {
|
||||||
reuseCache: !parseMozFormat.styleId || styleId === parseMozFormat.styleId,
|
reuseCache: !parseMozFormat.styleId || styleId === parseMozFormat.styleId,
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
errors.push(e.message);
|
||||||
|
}
|
||||||
parseMozFormat.styleId = styleId;
|
parseMozFormat.styleId = styleId;
|
||||||
return {sections, errors};
|
return {sections, errors};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user