R/error.R

Defines functions report_system_error

report_system_error <- function(msg, status) {

  if (status$status == 0) return()

  if (status$stderr == "") {
    stop(
      msg, ", unknown error, standard output:\n",
      yellow(status$stdout),
      call. = FALSE
    )

  } else {
    stop(
      underline(yellow(paste0("\n", msg, ", standard output:\n\n"))),
      yellow(status$stdout), "\n",
      underline(red("Standard error:\n\n")), red(status$stderr),
      call. = FALSE
    )
  }
}

Try the rcmdcheck package in your browser

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

rcmdcheck documentation built on Sept. 27, 2021, 5:13 p.m.