Closed KevCaz closed 3 years ago
So excited to look at this! I'll need a day or so to do so, but I can't wait :grin:
Hi @steffilazerte, Thanks! I'll have a look at all this later today or tomorrow, I was also thinking that I could add a simple test with the "server is down" URL, what do you think?
I think that'd be fantastic! Thanks!
Hi @steffilazerte,
I'm basically done, let me know if I need to do something else, again thanks for all your work on this, I know a few people using weathercan
for their research project and they all very grateful for its existence, which I guess means that they all are grateful for your work on this project!
Wonderful, thanks @KevCaz! That's great to hear that and also lovely to have contributions! I'll merge this in and finish prepping for the CRAN release. Take care!
@steffilazerte, sorry, I realize I forgot to add a new item in the NEWS.md... something like the one you proposed sounds good enough to me "better error checking has been for GET requests (see #120)".
Not a problem! I've added it in, and am now patting myself on the back for creating check_eccc()
(returns TRUE/FALSE depending if it can ping the website) and wrapping all my examples in if(check_eccc()) HA! hopefully no more failures.
Good luck!!
Following-up on #119,
I went a bit further than just adding a function
check_status()
, I introduceget_check()
that handles theGET()
requests and check status, which includes (1) a check of whether data are available and (2) the use ofhttr::stop_for_status()
as you are already using.get_check()
is used in the four main access points. I then checked the package, everything is fine, I just had to adjust one test, so it uses the new error message thrown. BTW, I think it would be worth turning the message belowhttps://github.com/ropensci/weathercan/blob/2bcad0938508d2760a96f354dd4066bb8c429b65/R/stations.R#L156-L159
into a message used by argument
task
inget_check()
. Let me know what do you think about all this.