R/utils.R

`%||%` <- function(x, y) if (is.null(x)) y else x

#' Capture calls on a stack trace for an inflight error.
#'
#' @param e error.
#' @return The \code{error} with a decorated \code{calls} attribute, a list
#'   of \code{call}s that led to the error.
capture_calls <- function(e) {
  e$calls <- sys.calls()
  signalCondition(e)
}
avantcredit/servicetests documentation built on May 11, 2019, 4:07 p.m.