Compare commits
2 Commits
master
...
catch_pars
Author | SHA1 | Date | |
---|---|---|---|
|
6a040acd07 | ||
|
381806c7c7 |
@ -29,14 +29,14 @@ carto.Renderer.prototype.render = function render(m, callback) {
|
|||||||
var output = [];
|
var output = [];
|
||||||
|
|
||||||
// Transform stylesheets into rulesets.
|
// Transform stylesheets into rulesets.
|
||||||
|
try { // Parser may throw
|
||||||
var rulesets = _(m.Stylesheet).chain()
|
var rulesets = _(m.Stylesheet).chain()
|
||||||
.map(function(s) {
|
.map(function(s) {
|
||||||
// Passing the environment from stylesheet to stylesheet,
|
// Passing the environment from stylesheet to stylesheet,
|
||||||
// allows frames and effects to be maintained.
|
// allows frames and effects to be maintained.
|
||||||
env = _(env).extend({filename:s.id});
|
env = _(env).extend({filename:s.id});
|
||||||
|
|
||||||
// @TODO try/catch?
|
var time = +new Date();
|
||||||
var time = +new Date(),
|
|
||||||
root = (carto.Parser(env)).parse(s.data);
|
root = (carto.Parser(env)).parse(s.data);
|
||||||
if (env.benchmark)
|
if (env.benchmark)
|
||||||
console.warn('Parsing time: ' + (new Date() - time) + 'ms');
|
console.warn('Parsing time: ' + (new Date() - time) + 'ms');
|
||||||
@ -44,6 +44,7 @@ carto.Renderer.prototype.render = function render(m, callback) {
|
|||||||
})
|
})
|
||||||
.flatten()
|
.flatten()
|
||||||
.value();
|
.value();
|
||||||
|
} catch (err) { callback(err, null); return; }
|
||||||
|
|
||||||
// Iterate through layers and create styles custom-built
|
// Iterate through layers and create styles custom-built
|
||||||
// for each of them, and apply those styles to the layers.
|
// for each of them, and apply those styles to the layers.
|
||||||
|
Loading…
Reference in New Issue
Block a user