ropensci / chirps

API Client for CHIRPS
https://docs.ropensci.org/chirps/
Other
31 stars 12 forks source link

According to CRAN policy, server failures should not be R errors #14

Closed adamhsparks closed 4 years ago

adamhsparks commented 4 years ago

CRAN has a policy (which I don't agree with) that server response failures should fail "gracefully" without an error message. To me, I'd prefer the script to stop and give me an informative message as we've done in chirps. I know I have a collaborator who contacted me after I made this change as well because they were using a tryCatch() to wrap a function from bomrang and this broke that functionality.

However, that's not what CRAN wants.

I've a tryCatch() function we can look at and discuss in bomrang that might be useful to refer to. It returns an invisible NULL if the server times out after checking network functionality and server responses, etc.

https://github.com/ropensci/bomrang/blob/77f14342188ea1e48362eb0bfdb3c60dd9510ab4/R/internal_functions.R#L13

Others in rOpenSci or the reviewers might be good to consult with as well.

kauedesousa commented 4 years ago

I looked at the documentation and it seems that you already did this, am I right?

adamhsparks commented 4 years ago

Hah, maybe I did! I need to recheck. I thought I saw some tryCatch() that ended in a stop() function

adamhsparks commented 4 years ago

Not sure what I saw, you're right though! Sorry for the false alarm