Skip to content

Commit

Permalink
add try
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Oct 17, 2023
1 parent 746e6db commit 5264f0b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions R/repo.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,20 @@ repo <- R6::R6Class("repo",
final_url <- headers$location
archive_folder <- sprintf("archive-%s_%s", self$organization, self$name)
fs::dir_create(archive_folder)
curl::curl_download(
final_url,
file.path(archive_folder, sprintf("%s_%s_migration_archive.tar.gz", self$organization, self$name))
try <- try(
curl::curl_download(
final_url,
file.path(archive_folder, sprintf("%s_%s_migration_archive.tar.gz", self$organization, self$name))
),
silent = TRUE
)
self$downloaded <- TRUE
if (inherits(try, "try-error")) {
self$downloaded <- FALSE
message("Download failed!")
} else {
self$downloaded <- TRUE
}

}
),
active = list(migration_state = function() {
Expand Down

0 comments on commit 5264f0b

Please sign in to comment.