Skip to content

Commit c8004be

Browse files
Add simple error handling for 404
Should be made more robust
1 parent 8cb79e5 commit c8004be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/dst_get_data.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ dst_get_data <- function(table,
7979
dst_data <- httr::GET(dst_url)
8080

8181
# Make sure the returned status is OK
82-
if (httr::status_code(dst_data) != 200) {
82+
if (httr::status_code(dst_data) == 404) {
83+
stop("The resource you requested have not been found.
84+
Please make sure that the table is in `tables`")
85+
} else if (httr::status_code(dst_data) != 200) {
8386
stop(httr::content(dst_data, encoding = "UTF-8")$message)
8487
}
8588

0 commit comments

Comments
 (0)