R/stop_quietly.R

Defines functions stop_quietly

Documented in stop_quietly

#' Stop Quietly
#'
#' Internal function that allows to stop a function with a non-error message
#' @param msg Character string
#' @examples
#' stop_quietly("This is a non-error message");
#' @keywords internal
#' @export
stop_quietly <- function(msg) {
  message(msg)
  opt <- options(show.error.messages = FALSE)
  on.exit(options(opt))
  stop(msg)
}
ptimoner/inAccMod documentation built on Jan. 27, 2025, 9:34 a.m.