This function behaves as `on.exit()`, but is run on error, and supports mappers.
on_error(f)
a function to call on error
A local error handler.
# NOT RUN { y <- function(num){ on_error(~ write( Sys.time(), "error_log.txt", append = TRUE) ) log(num) } # }
Run the code above in your browser using DataLab