R/util-successCheck.R

Defines functions success_check

success_check <- function(res) {

  if (!res$status_code) {
    stop(paste(
      "Error code:", res$error$code, "\n",
      "Error message:", res$error$info,
      "Error type:", res$error$type, "\n"
    ), call. = FALSE)
  }

  return(res)
}

Try the currencyapi package in your browser

Any scripts or data that you put into this service are public.

currencyapi documentation built on May 31, 2023, 8:56 p.m.