DOI-USGS / dataRetrieval

This R package is designed to obtain USGS or EPA water quality sample data, streamflow data, and metadata directly from web services.
https://doi-usgs.github.io/dataRetrieval/
Other
259 stars 84 forks source link

Failing gracefully #581

Closed ldecicco-USGS closed 2 years ago

ldecicco-USGS commented 2 years ago

We've been pinged for not failing gracefully on our examples in CRAN (this is the 2nd time). CRAN doesn't want the functions to stop or error if the server returns an error message. So...I switched the getWebService function to use httr::message_for_status (instead of httr::stop_for_status), and return a NULL. This is consistent with what @dblodgett-usgs is doing with sbtools.

@wdwatkins or @dblodgett-usgs ...if one of you could glance at the code to see if it looks good to you, that would be great. I actually got to test it quite extensively yesterday because WQP was failing all over the place (someone was overloading them).

We need to resubmit to CRAN in the next couple of days to avoid having it taken down.

dblodgett-usgs commented 2 years ago

This seems reasonable -- Thinking about how it would have been done if this "no errors ever on web service calls" had been the initial design, I feel like it would have ultimately done what you are doing if in a little less "bolt on" way. I'd say :shipit:

ldecicco-USGS commented 2 years ago

Daw...I haven't seen the ship-it squirrel in forever!