Skip to content

Commit e5ef0f8

Browse files
committed
Fix test failures
1 parent e70f9bb commit e5ef0f8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mapbox_tilesets/scripts/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,12 @@ def estimate_area(features, precision, no_validation=False, force_1cm=False):
746746
)
747747

748748
# builtins.list because there is a list command in the cli & will thrown an error
749-
features = builtins.list(features)
749+
try:
750+
features = builtins.list(features)
751+
except (ValueError, json.decoder.JSONDecodeError):
752+
raise errors.TilesetsError(
753+
"Error with feature parsing. Ensure that feature inputs are valid and formatted correctly. Try 'tilesets estimate-area --help' for help."
754+
)
750755

751756
# expect users to bypass source validation when users rerun command and their features passed validation previously
752757
if not no_validation:
@@ -756,7 +761,7 @@ def estimate_area(features, precision, no_validation=False, force_1cm=False):
756761
features = builtins.list(filter_features(features))
757762

758763
area = utils.calculate_tiles_area(features, precision)
759-
area = str(round(area))
764+
area = str(int(round(area)))
760765

761766
click.echo(
762767
json.dumps(

0 commit comments

Comments
 (0)