Skip to content

Commit 51acd7d

Browse files
committed
more http_error use
1 parent 3513574 commit 51acd7d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

R/ReadPubMed.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,10 @@ GetPubMedRelated <- function(id, database = "pubmed", batch.mode = TRUE,
218218
base.url <- "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi"
219219

220220
## results <- try(getForm(base.url, .params = parms))
221-
results <- try(GET(base.url, query = parms))
222-
if (inherits(results, "try-error"))
223-
return(NA)
221+
results <- GET(base.url, query = parms)
222+
if (http_error(results))
223+
stop(gettextf("NCBI E-Utilities query error [%s]", status_code(results)),
224+
.call = FALSE)
224225

225226
tdoc <- read_xml(results)
226227
max.results <- rep(max.results, l = id.len)

0 commit comments

Comments
 (0)