R/tryCatchWE.R

Defines functions tryCatchWE

tryCatchWE <- function(expr)
{
  W <- NULL
  w.handler <- function(w){ # warning handler
    W <<- w
    invokeRestart("muffleWarning")
  }
  list(value = withCallingHandlers(tryCatch(expr, error = function(e) e),
                                   warning = w.handler),
       warning = W)
}
c5sire/quipu documentation built on Nov. 14, 2020, 9:09 a.m.