## Not run:
# lm <- errorize(stats::lm)
# data("cars")
# lm(speed ~ dist, data = cars) # works
# lm(speed ~ missing_variable, data = cars) # this errors out and saves the data to a .Rds file
#
# # read the saved data back in (timestamp on filename will change based on when the above is run)
# er <- readRDS('./lm_error_1478361734.Rds')
#
# # use do.call to recreate the error
# do.call(er$fxn, er$arglst)
# ## End(Not run)
Run the code above in your browser using DataLab