Skip to content
Open
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
Expand Up @@ -2,6 +2,7 @@

* Implement reading `vpts` data from a local directory (#135).
* Clarify HTTP 429 error for the Netherlands (#165).
* Clarify error for Estonia and propagate call (#173).
* For Romania match deviating file format (thanks to Sorin Burcea, #167).

# getRad 0.2.4
Expand Down
5 changes: 3 additions & 2 deletions R/get_pvol_ee.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ get_pvol_ee <- function(radar, time, ..., call = rlang::caller_env()) {
httr2::resp_body_json()
if (files$numFound == 0 || length(files$documents) != 1) {
cli::cli_abort(
"The expected number of files is not found.",
class = "getRad_error_get_pvol_ee_differing_n_files"
"The expected number of files is not found for this Estonian Radar. This can occur when no data is available.",
class = "getRad_error_get_pvol_ee_differing_n_files",
call = call
)
}
pvol <- withr::with_tempfile("file", fileext = ".h5", {
Expand Down
10 changes: 10 additions & 0 deletions tests/testthat/test-get_pvol_ee.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ test_that("Pvol for estonia can be downloaded", {
expect_true(bioRad::is.pvol(pvol))
expect_identical(pvol$datetime, lubridate::with_tz(time, "UTC"))
})

test_that("Pvol for estonia fails on missing data", {
expect_error(
get_pvol(
radar = "eesur",
structure(1776221700, class = c("POSIXct", "POSIXt"))
),
class = "getRad_error_get_pvol_ee_differing_n_files"
)
})
Loading