powered by
safe_callback(f)
f1 <- function(x) { if (x < 0) stop("Negative value") sqrt(x) } f2 <- safe_callback(f1) f2(-10)
Run the code above in your browser using DataLab