Skip to content
Prev 13240 / 21307 Next

[Bioc-devel] tokay2 error with httr

Hi Klara --

You have code structured like

   out <- tryCatch({
       response = httr::GET(url)
       ...
    }, error = function(cond) {
       ...
       ... htr::http_status(response)$message
    })

so if GET() fails, response is undefined; I guess this is what happened, 
the "why" is a mystery but could be as simple as transient internet 
connectivity.

It seems like you could instead report conditionMessage(cond) in the 
error function (catching the GET() error), and use 
httr::stop_for_status() to check for invalid status response from the 
server.

FWIW your code in utils.R is not consistently indented (sometimes tabs, 
sometimes spaces); I'd strongly suggest 4 spaces and no tabs. Also 
message(paste(...)) can usually be represented simply as message(..., 
including multiline messages.

Martin
On 04/15/2018 12:25 PM, Klara Kaleb wrote:
This email message may contain legally privileged and/or...{{dropped:2}}