tests/example5.R

library(winch)

foo <- function() {
  winch_call(function() bar())
}

bar <- function() {
  winch_stop("oops")
}

if (winch_available() && require(magrittr) && requireNamespace("rlang")) {
  options(
    error = rlang::entrace,
    rlang_backtrace_on_error = "full",
    rlang_trace_use_winch = TRUE
  )

  tryCatch(foo() %>% identity(), error = identity)
}

Try the winch package in your browser

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

winch documentation built on April 20, 2023, 9:14 a.m.