[Bioc-devel] How to handle Empty reply from server from httr package

Jianhong Ou, Ph.D. j|@nhong@ou @end|ng |rom duke@edu
Thu Dec 10 18:15:32 CET 2020


Hi all,

Sometime my package got "Empty reply from server" error when I using httr package.
The pseudo-code I used to handle error is like this:

library(httr)
APIurl <- "https://www.ebi.ac.uk/proteins/api/features?offset=0&size=-1&reviewed=true&types=DNA_BIND%2CMOTIF%2CDOMAIN&taxid=9606&accession=K7PPA8%2CP04637%2CQ53GA5%2CH2EHT1%2CA0A087X1Q1%2CA0A087WXZ1%2CA0A087WT22"
tryCatch({
response <- GET(featureURL)
if(!http_error(response)){    content <- httr::content(response)}
}, error=function(e){
  message(e)
},warning=function(w){
  message(w)
},interrupt=function(i){
  message(i)
})

But I did not get the error handled. What is the correct way to handle the curl 52 error?
Thank you for your help.


Yours Sincerely,

Jianhong Ou

Email: jianhong.ou using duke.edu
Bioinformatician II
Department of Cell Biology
Duke University School of Medicine
Durham, NC, 27710

Confidentiality Notice:\ This e-mail message, including ...{{dropped:12}}



More information about the Bioc-devel mailing list