tests/testthat/ressources/with-stop-error-trace.R

testthat::local_reproducible_output()
handlers <- evaluate::new_output_handler(
  calling_handlers = list(error = function(cnd) rlang::entrace(cnd))
)
evaluate::evaluate(function() {
  f <- function() g()
  g <- function() h()
  h <- function() stop("!")
  f()
}, stop_on_error = 2L, output_handler = handlers)

Try the evaluate package in your browser

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

evaluate documentation built on April 4, 2025, 2:34 a.m.