Skip to content
Snippets Groups Projects
Commit 2464b509 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Moved status check.

parent ed2ebcde
No related branches found
No related tags found
1 merge request!151readr for importRDB1
......@@ -55,22 +55,24 @@ importWQP <- function(obs_url, zip=FALSE, tz=""){
httpHEAD(obs_url, headerfunction = h$update)
headerInfo <- h$value()
numToBeReturned <- as.numeric(headerInfo["Total-Result-Count"])
if(headerInfo['Total-Result-Count'] == "0"){
warning("No data returned")
return(data.frame())
}
if(is.na(numToBeReturned) | numToBeReturned == 0){
for(i in grep("Warning",names(headerInfo))){
warning(headerInfo[i])
}
return(data.frame())
}
if(headerInfo['status'] == "200"){
numToBeReturned <- as.numeric(headerInfo["Total-Result-Count"])
if(headerInfo['Total-Result-Count'] == "0"){
warning("No data returned")
return(data.frame())
}
if(is.na(numToBeReturned) | numToBeReturned == 0){
for(i in grep("Warning",names(headerInfo))){
warning(headerInfo[i])
}
return(data.frame())
}
if(zip){
temp <- tempfile()
options(timeout = 120)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment