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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# getRad (development version)

* Clarify HTTP 429 error for the Netherlands (#165).
* For Romania match deviating file format (thanks to Sorin Burcea, #167).

# getRad 0.2.4

Expand Down
16 changes: 15 additions & 1 deletion R/get_pvol_ro.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,19 @@ get_pvol_ro <- function(radar, time, ..., call = rlang::caller_env()) {
urls <- glue::glue(
"https://opendata.meteoromania.ro/radar/{toupper(substr(radar,3,5))}/{toupper(substr(radar,3,5))}_{strftime(time,'%Y%m%d%H%M', tz='UTC')}0200{params}.hdf"
)
read_pvol_from_url_per_param(urls, param = "all", call = call)
tryCatch(
read_pvol_from_url_per_param(urls, param = "all", call = call),
error = function(cnd) {
urls_updated <- glue::glue(
"https://opendata.meteoromania.ro/radar/{toupper(substr(radar,3,5))}/{toupper(substr(radar,3,5))}_{strftime(time,'%Y%m%d%H%M', tz='UTC')}0300{params}.hdf"
)
if (
rlang::has_name(cnd, "parent") && inherits(cnd$parent, "httr2_http_404")
) {
read_pvol_from_url_per_param(urls_updated, param = "all", call = call)
} else {
return(cnd)
}
}
)
}