R/CHECKING-check_status.R

Defines functions .check_status

.check_status <- function(status) {
  
  if (is.null(status)) {
    stop("No ChemSpider query \"status\" provided.", 
         call. = FALSE)
  }
  
  if (length(status) > 1L) {
    stop("This function can only handle a single status entry.", 
         call. = FALSE)
  }
  
  if (!is.character(status)) {
    stop("The provided ChemSpider query status needs to be a character vector.", 
         call. = FALSE)
  }
  
  if (status != "Complete") {
    stop("Query computation not yet complete.", 
         call. = FALSE)
  }

}
NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.