Reprex:
bench::mark(if (runif(1) < 0.01) stop("stop"))
nothing is printed here...
Somewhat surprisingly, the error is actually there, you can catch it:
tryCatch(bench::mark(if (runif(1) < 0.01) stop("stop")), error = identity)
#> <simpleError in force(expr): stop>
Reprex:
nothing is printed here...
Somewhat surprisingly, the error is actually there, you can catch it: