Skip to content

Commit

Permalink
API now returns a message, not blank, when outside of US...
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollist committed Jun 16, 2023
1 parent 63f6447 commit d07f14a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/get_elev_point.R
Expand Up @@ -219,7 +219,9 @@ get_epqs <- function(locations, units = c("meters","feet"),
return(NA)
}

if(httr::status_code(resp) == 200 & httr::content(resp, "text", encoding = "UTF-8") == ""){
if(httr::status_code(resp) == 200 &
httr::content(resp, "text", encoding = "UTF-8") ==
"Invalid or missing input parameters."){
message("API returned an empty repsonse (e.g. location in ocean or not in U.S.). NA returned for elevation")
return(NA)
} else if(httr::status_code(resp) == 200){
Expand Down

0 comments on commit d07f14a

Please sign in to comment.