diff --git a/R/geojson_list.R b/R/geojson_list.R index c4e62ec..2cc4b59 100644 --- a/R/geojson_list.R +++ b/R/geojson_list.R @@ -237,7 +237,7 @@ as.geo_list <- function(x, from) structure(x, class = "geo_list", from = from) lint_polygon_list <- function(x) { if (!identical(x[[1]], x[[length(x)]])) { - stop("First and last point in a polygon must be identical", + cli::cli_abort("First and last point in a polygon must be identical", call. = FALSE ) } @@ -362,7 +362,7 @@ num_to_geo_list <- function(x, geometry = "point", type = "FeatureCollection") { geom <- capwords(match.arg(geometry, c("point", "polygon"))) res <- tryCatch(as.numeric(x), warning = function(e) e) if (inherits(res, "simpleWarning")) { - stop("Coordinates are not numeric", call. = FALSE) + cli::cli_abort("Coordinates are not numeric", call. = FALSE) } else { switch(type, FeatureCollection = { @@ -538,7 +538,7 @@ guess_latlon <- function(x, lat = NULL, lon = NULL) { } return(list(lon = lngs, lat = lats)) } else { - stop("Couldn't infer longitude/latitude columns, please specify with 'lat'/'lon' parameters", call. = FALSE) + cli::cli_abort("Couldn't infer longitude/latitude columns, please specify with 'lat'/'lon' parameters", call. = FALSE) } } else { return(list(lon = lon, lat = lat)) diff --git a/R/upload_zone_set.R b/R/upload_zone_set.R index 13aee04..54ce1d3 100644 --- a/R/upload_zone_set.R +++ b/R/upload_zone_set.R @@ -98,8 +98,7 @@ upload_zone_set <- function(login_email, # check that there aren't too many zones # check_zone_size(zones = zones_sf) if (nrow(zones_sf) >= 7000) { - stop(("There are too many zones in this zone set.")) - return() + cli::cli_abort("There are too many zones in this zone set.") } # if the coordinate reference system is not WGS84, transform