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
256 stars 85 forks source link

Give better messages from 400 returns from the WQP #620

Closed ldecicco-USGS closed 2 years ago

ldecicco-USGS commented 2 years ago

Here's an example:

bbox_6120 <- c(xmin = 178.768914, ymin = 51.398187, 
               xmax = 180.768914, ymax = 53.398187)

x <- whatWQPdata(sampleMedia = c("Water", "water"), 
                 siteType = "Stream", 
                 bBox = bbox_6120)

image

If we run getWebServiceData in debug mode, we see that on line 33, we're making an assumption that the 400 message is coming back as plain text (that is what it is for NWIS). We can add something to also look at the warnings from the header