Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# getRad (development version)

* Clarify HTTP 429 error for the Netherlands (#165).

# getRad 0.2.4

* Make error messages more consistent (#146).
Expand Down
13 changes: 13 additions & 0 deletions R/get_pvol_nl.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ get_pvol_nl <- function(radar, time, ..., call = rlang::caller_env()) {
class = "getRad_error_get_pvol_nl_authorization_failure",
call = call
)
},
httr2_http_429 = function(cnd) {
cli::cli_abort(
c(
"There was a rate limitation error (HTTP 429) while getting data from the Netherlands.",
"i" = "This frequently occurs when using the anonymous key, if it occurs repeatedly consider requesting a registered key ({.url https://developer.dataplatform.knmi.nl/open-data-api#token}). ",
"i" = "You can check the current value of {.val nl_api_key} with
{.code get_secret(\"nl_api_key\")}."
),
cnd = cnd,
class = "getRad_error_get_pvol_nl_429_failure",
call = call
)
}
)
# This request retrieves the file
Expand Down
Loading