Skip to content

Commit

Permalink
Better stop for status handling in R client
Browse files Browse the repository at this point in the history
  • Loading branch information
krivard committed May 3, 2023
1 parent 160d699 commit 0442d9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R-packages/covidcast/R/covidcast.R
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,8 @@ covidcast <- function(data_source, signal, time_type, geo_type, time_values,
}

msg <- "fetch data from API"
if (httr::status_code(response) %in% c(429, 401)) {
msg <- paste(msg, "anonymously - to register for an API key, visit TODO")
if (is.na(auth)) {
msg <- paste(msg, "anonymously")
}
httr::stop_for_status(response, task = msg)

Expand Down

0 comments on commit 0442d9a

Please sign in to comment.