Skip to content

Commit 216e23e

Browse files
Use cli
1 parent 19c4a11 commit 216e23e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Imports:
2020
httr,
2121
jsonlite,
2222
lubridate,
23-
stringr
23+
stringr,
24+
cli
2425
Suggests:
2526
knitr,
2627
rmarkdown,

R/dst_get_data.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ dst_get_data <- function(table,
9292

9393
# Make sure the returned status is OK
9494
if (httr::status_code(dst_data) == 404 && table %in% dkstat::tables$id) {
95-
stop("The resource could not be reached.
96-
Please submit an issue on https://github.com/rOpenGov/dkstat/issues")
95+
cli::cli_abort("The resource could not be reached.
96+
Please submit an issue on {.url {'https://github.com/rOpenGov/dkstat/issues'}}")
9797
} else if (httr::status_code(dst_data) == 404) {
98-
stop("The resource you requested have not been found.
98+
cli::cli_abort("The resource you requested have not been found.
9999
Please make sure that the table is in `tables`")
100100
} else if (httr::status_code(dst_data) != 200) {
101101
stop(httr::content(dst_data, encoding = "UTF-8")$message)

0 commit comments

Comments
 (0)