Skip to content

Commit

Permalink
handle invalid json during Mapnik parse
Browse files Browse the repository at this point in the history
  • Loading branch information
alianthes committed Nov 6, 2015
1 parent ce7f47a commit e3f91f5
Show file tree
Hide file tree
Showing 3 changed files with 583 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/geojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ GeoJSON.prototype.getExtent = function(callback) {

GeoJSON.prototype.getDetails = function(callback) {
// Setup vector layers json
var actual = this.datasource.describe();
try {
var actual = this.datasource.describe();
} catch (err) {
return callback(invalid('Invalid geojson'));
}
var fields = actual.fields;
var json = {
vector_layers: [
Expand Down
Loading

0 comments on commit e3f91f5

Please sign in to comment.