From 18172c28f9feefa77779386d04d3c67986e9da00 Mon Sep 17 00:00:00 2001 From: ross-hull <117927497+ross-hull@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:18:45 +0100 Subject: [PATCH] Update R/get_latest_resource_id.R Co-authored-by: James McMahon --- R/get_latest_resource_id.R | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/R/get_latest_resource_id.R b/R/get_latest_resource_id.R index c519b6e..3f89deb 100644 --- a/R/get_latest_resource_id.R +++ b/R/get_latest_resource_id.R @@ -84,11 +84,10 @@ get_latest_resource_id <- function(dataset_name) { all_id_data_first_row <- all_id_data %>% dplyr::slice(1) - # if the resource at the top as appearing on the open data platform also has the most - # recent date created, return it. Otherwise return warning + # If the resource at the top as appearing on the open data platform also has the most + # recent date created, return it. Otherwise, error if (all_id_data_first_row$created_date == all_id_data_first_row$most_recent_date_created) { return(all_id_data_first_row$id) - } else { - (warning("most recent id could not be identified")) - } + } + cli::cli_abort("The most recent id could not be identified")) }