Skip to content

Commit

Permalink
better warning with {cli}
Browse files Browse the repository at this point in the history
  • Loading branch information
JoFrhwld committed Sep 26, 2023
1 parent be62751 commit 3311a39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RoxygenNote: 7.2.3
URL: https://github.com/JoFrhwld/densityarea, https://jofrhwld.github.io/densityarea/
BugReports: https://github.com/JoFrhwld/densityarea/issues
Imports:
cli,
dplyr,
ggdensity,
isoband,
Expand Down
7 changes: 3 additions & 4 deletions R/density_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ get_isolines_safely <- function(...){
if(!is.null(iso_result$error)){
dots <- rlang::dots_list(...)
data_len <- length(dots$x)
warning(
glue::glue(
"There was a problem calculating probability isolines.\nℹ There were {data_len} values in the input."
)
cli::cli_warn(
c("There was a problem calculating probability isolines.",
"i" = "There {?was/were} {data_len} x,y pair{?s} in the input.")
)
}

Expand Down
1 change: 1 addition & 0 deletions usethis_hist.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ usethis::use_package("sf")
usethis::use_package("tidyr")
usethis::use_package("sfheaders")
usethis::use_package("vctrs")
usethis::use_package("cli")

## suggests ----
usethis::use_package("readr", type = "Suggests")
Expand Down

0 comments on commit 3311a39

Please sign in to comment.