Catch parser exceptions (it does throw!)
This commit is contained in:
parent
a04ad1c388
commit
07ca2dad27
@ -33,9 +33,10 @@ carto.Renderer.prototype.render = function render(m, callback) {
|
||||
// allows frames and effects to be maintained.
|
||||
env = _(env).extend({filename:s.id});
|
||||
|
||||
// @TODO try/catch?
|
||||
var time = +new Date(),
|
||||
root = (carto.Parser(env)).parse(s.data);
|
||||
var time = +new Date();
|
||||
// Parser may throw
|
||||
try { root = (carto.Parser(env)).parse(s.data); }
|
||||
catch (err) { callback(err, null); return; }
|
||||
if (env.benchmark)
|
||||
console.warn('Parsing time: ' + (new Date() - time) + 'ms');
|
||||
return root.toList(env);
|
||||
|
Loading…
Reference in New Issue
Block a user