From c52b30f67e77f6d49041e52e0e81d8b96c5d7dd0 Mon Sep 17 00:00:00 2001 From: aleksanderbl29 <73799306+aleksanderbl29@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:11:46 +0100 Subject: [PATCH] Add case for 404 when table is in registry --- R/dst_get_data.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/dst_get_data.R b/R/dst_get_data.R index 2689ac1..bd4d3b5 100644 --- a/R/dst_get_data.R +++ b/R/dst_get_data.R @@ -79,7 +79,10 @@ dst_get_data <- function(table, dst_data <- httr::GET(dst_url) # Make sure the returned status is OK - if (httr::status_code(dst_data) == 404) { + if (httr::status_code(dst_data) == 404 && table %in% dkstat::tables$id) { + stop("The resource could not be reached. + Please submit an issue on https://github.com/rOpenGov/dkstat/issues") + } else if (httr::status_code(dst_data) == 404) { stop("The resource you requested have not been found. Please make sure that the table is in `tables`") } else if (httr::status_code(dst_data) != 200) {