throw a ParseError, instead of just an Error
This commit is contained in:
parent
543fb96a03
commit
b60c296e6e
@ -150,7 +150,7 @@ less.parser = {
|
||||
zone = stylize(input.slice(start, i), 'green') +
|
||||
stylize(input.slice(i, end), 'yellow');
|
||||
|
||||
throw new(Error)("Parse Error on line " + line + ":\n" + zone);
|
||||
throw { name: "ParseError", message: "Parse Error on line " + line + ":\n" + zone };
|
||||
}
|
||||
return tree;
|
||||
},
|
||||
|
@ -11,9 +11,13 @@ var less = require('lib/less/adapters/server');
|
||||
fs.readdirSync('test/less').forEach(function (file) {
|
||||
toCSS('test/less/' + file, function (err, less) {
|
||||
read(path.join('test/css', path.basename(file, '.less')) + '.css', function (e, css) {
|
||||
sys.print(file + ": ")
|
||||
sys.print("- " + file + ": ")
|
||||
if (less === css) { sys.print('OK') }
|
||||
else { sys.print(e || err) }
|
||||
else if (err && err.name == 'ParseError') {
|
||||
sys.print("!\n " + err.message);
|
||||
} else {
|
||||
sys.print("=/=");
|
||||
}
|
||||
sys.puts("");
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user