Browse Source

feat(geo_common): improve boundary.rect error message

In the case where a min lat/lon is larger than a max lat/lon, the error
message was a bit confusing as it did not show the actual property name
or the values that are causing errors.
pull/1207/head
Julian Simioni 6 years ago
parent
commit
16667199cd
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 2
      sanitizer/_geo_common.js

2
sanitizer/_geo_common.js

@ -49,7 +49,7 @@ function sanitize_bbox_min_max(raw, key_prefix) {
const min = parseFloat(raw[`${key_prefix}.min_${dimension}`]);
if (max <= min) {
throw new Error(`min_${dimension} is larger than max_${dimension} in ${key_prefix}`);
throw new Error(`${key_prefix}.min_${dimension} (${min}) must be less than ${key_prefix}.max_${dimension} (${max})`);
}
});
}

Loading…
Cancel
Save