Skip to content

Commit

Permalink
Better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dramanica committed Jan 26, 2024
1 parent a3ba36a commit a7d3f2a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/download_chelsa.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ download_chelsa <- function(dataset, bio_var, filename) {
time_vector = time_vector, time_bp=FALSE)
if (!edit_res){
file.remove(vrt_path)
stop("something went wrong setting up this dataset", , "\n the dataset wil need downloading again")
stop("something went wrong setting up this dataset", "\n the dataset will need downloading again")
}
return(TRUE)
}
Expand Down
2 changes: 1 addition & 1 deletion R/download_chelsa_trace21k.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ download_chelsa_trace21k <- function(dataset, bio_var, filename=NULL, time_bp=NU
time_vector = time_bp, time_bp=TRUE)
if (!edit_res){
file.remove(vrt_path)
stop("something went wrong setting up this dataset", , "\n the dataset wil need downloading again")
stop("something went wrong setting up this dataset", "\n the dataset wil need downloading again")
}
return()
}
Expand Down
2 changes: 1 addition & 1 deletion R/download_worldclim_future.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ download_worldclim_future <- function(dataset, bio_var, filename = NULL) {
time_bp = FALSE)
}
if (!file.exists(filename)){
stop("something went wrong setting up this dataset")
stop("something went wrong setting up this dataset", "\n the dataset will need downloading again")
}
return(TRUE)
}

0 comments on commit a7d3f2a

Please sign in to comment.