Trying to catch subs union error

This commit is contained in:
vjrj 2018-02-12 16:59:03 +01:00
parent 8a6584acb9
commit 8e924d1de4

View file

@ -55,6 +55,7 @@ const subsUnion = (union, options) => {
parts: 144
};
options.subs.forEach((sub) => {
try {
if (sub.location && sub.location.lat && sub.location.lon && sub.distance) {
check(sub.location.lon, Number);
check(sub.location.lat, Number);
@ -64,6 +65,10 @@ const subsUnion = (union, options) => {
} else {
console.error(`Wrong subscription ${JSON.stringify(sub)}`);
}
} catch (e) {
console.error(e);
console.error(`Wrong subscription trying to make union ${JSON.stringify(sub)}`);
}
});
const unionJson = unify(unionGroup.getLayers());
union = L.geoJson(unionJson);