Skip to content

Commit

Permalink
condense download failed message
Browse files Browse the repository at this point in the history
  • Loading branch information
khufkens committed Aug 27, 2024
1 parent d05bfe2 commit 29ab64b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions R/service-ds.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,11 @@ ds_service <- R6::R6Class("ecmwfr_ds",

# trap (http) errors on download, return a general error statement
if (httr::http_error(response)) {
if (fail_is_error) {
stop("Download failed with error ", response$status_code)
} else {
warning("Download failed with error ", response$status_code)
return(self)
}
warn_or_error(
paste0("Download failed with error ", response$status_code),
call. = FALSE,
error = fail_is_error
)
}

private$downloaded <- TRUE
Expand Down

0 comments on commit 29ab64b

Please sign in to comment.