R/conditions.R

Defines functions arad_redact arad_abort

arad_abort <- function(message, class = "arad_error") {
  condition <- structure(
    list(message = message, call = NULL),
    class = c(class, "arad_error", "error", "condition")
  )
  stop(condition)
}

arad_redact <- function(text, secret) {
  if (is.null(secret) || length(secret) != 1L || is.na(secret) || !nzchar(secret)) {
    return(text)
  }
  gsub(secret, "<redacted>", text, fixed = TRUE)
}

Try the aradR package in your browser

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

aradR documentation built on Oct. 15, 2026, 5:08 p.m.