Skip to content

Commit

Permalink
add tryCatch to get_accession_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Wytamma committed Feb 1, 2024
1 parent 4302248 commit 9f8b425
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/core.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9f8b425

Please sign in to comment.