Skip to content

Commit

Permalink
Catch parsing exception and log. (#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
billingb authored Sep 8, 2023
1 parent 940c2fe commit d2c2f6c
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,16 @@ class N2ModelSource extends Vector {
wkt = docInfo.simplifications[docInfo.simplifiedName];
docInfo.simplifiedInstalled = docInfo.simplifiedName;
}
var geometry = wktFormat.readGeometryFromText(wkt);
geometry.transform('EPSG:4326', _this.mapProjCode);
let geometry;
try {
geometry = wktFormat.readGeometryFromText(wkt);
geometry.transform('EPSG:4326', _this.mapProjCode);
} catch (e) {
$n2.log('Error parsing wkt for doc with id ' + docId);
continue;
}

var feature = new Feature();

try {
feature.setGeometry(geometry);
}catch (err){
Expand Down

0 comments on commit d2c2f6c

Please sign in to comment.