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 R/biocBuildReportDB.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ biocBuildReportDB <- function(
urls <- .get_build_report_tgz_url(version, pkgType)
names(urls) <- pkgType
urls <- Filter(.url_exists, urls)
if (!length(urls))
stop("Bioconductor build report could not be reached", call. = FALSE)

tempfolders <- replicate(length(urls), tempfile())

Expand Down
2 changes: 2 additions & 0 deletions R/biocBuildStatusDB.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ biocBuildStatusDB <- function(
urls <- get_build_status_db_url(version, pkgType)
names(urls) <- pkgType
urls <- Filter(.url_exists, urls)
if (!length(urls))
stop("Bioconductor build report could not be reached", call. = FALSE)

url_list <- lapply(
urls,
Expand Down
8 changes: 6 additions & 2 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ get_deprecated_status_df <- function(version) {
if (
identical(nrow(bquery), 1L) && (is.na(needsUpdate) || needsUpdate)
)
bfcdownload(
x = bfc, rid = bquery[["rid"]], ask = FALSE
tryCatch(
bfcdownload(x = bfc, rid = bquery[["rid"]], ask = FALSE),
error = function(e) warning(
"could not refresh ", url, "; using cached copy: ",
conditionMessage(e), call. = FALSE
)
)

bfcrpath(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/helper-network.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' Bioconductor-hosted resources specifically (general internet access does
#' not guarantee bioconductor.org is up).
skip_if_bioc_offline <- function() {
testthat::skip_on_cran()
testthat::skip_if_not(
.bioc_reachable(), "bioconductor.org is not reachable"
)
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test_biocBuildStatusDB.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ test_that("biocBuildStatusDB errors on an invalid pkgType", {
"'arg' should be one of"
)
})

test_that("biocBuildStatusDB errors clearly when no build report URL is reachable", {
testthat::local_mocked_bindings(.url_exists = function(url) FALSE)
expect_error(biocBuildStatusDB("devel"), "could not be reached")
})
Loading