From 9f8b42567c15bddd672954c674e7bed721671f7a Mon Sep 17 00:00:00 2001 From: Wytamma Wirth Date: Thu, 1 Feb 2024 15:29:37 +1100 Subject: [PATCH] add tryCatch to get_accession_ids --- R/core.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/core.R b/R/core.R index 4dd4bc8..4a5a276 100644 --- a/R/core.R +++ b/R/core.R @@ -148,8 +148,10 @@ get_accession_ids <- function(credentials) { j = httr::content(res, as = 'parsed') url <- extract_first_match("sys.downloadFile\\(\"(.*)\",", j$responses[[1]]$data) log.debug(paste0('https://www.epicov.org/', url)) - df <- read.csv(paste0('https://www.epicov.org/', url), header=F) - names(df) <- c('accession_id') + tryCatch( + df <- read.csv(paste0('https://www.epicov.org/', url), header=F, col.names = c('accession_id')), + error = function(e) df <- data.frame(col.names = c('accession_id')) + ) # back send_back_cmd(credentials$sid, selection_pid_wid$wid, selection_pid_wid$pid, credentials$selection_panel_cid) resetQuery(credentials)