Skip to content

Commit

Permalink
Merge pull request #169 from CVPIA-OSC/add_stop
Browse files Browse the repository at this point in the history
added stop to report_df
  • Loading branch information
alvizek authored Aug 2, 2023
2 parents 47641f1 + d4151be commit 26fdca0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions R/api-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ evaluate_edi_package <- function(user_id, password, eml_file_path, environment =
report_df <- generate_report_df(response)
assign("report_df", report_df, envir = .GlobalEnv)
print("Please check for errors in the report_df in .GlobalEnv")
return(report_df)
break
stop(report_df)
}
else if(iter > max_iter) {
stop("Request timed out, check that your inputs are all valid and try again")
Expand Down Expand Up @@ -160,8 +159,7 @@ upload_edi_package <- function(user_id, password, eml_file_path, environment = "
message != "Attempting to insert a data package that already exists in PASTA") {
report_df <- generate_report_df(check_error)
message("EML not valid. Please fix errors in report dataframe or if report dataframe comes back empty please try to evaluate_edi_package().")
return(report_df)
break
stop(report_df)
} else {
iter <- 0
max_iter <- 20
Expand Down Expand Up @@ -250,8 +248,7 @@ update_edi_package <- function(user_id, password, existing_package_identifier, e
message != paste0("Attempting to update a data package to revision ", "'", revision_number, "' ", "but an equal")) {
report_df <- generate_report_df(check_error)
message("EML not valid. Please fix errors in report dataframe or if report dataframe comes back empty please try to evaluate_edi_package().")
return(report_df)
break
stop(report_df)
} else {
iter <- 0
max_iter <- 10
Expand Down

0 comments on commit 26fdca0

Please sign in to comment.