R/utils-with_recovery.R

Defines functions with_recovery

#' Run code with recovery
#'
#' @inheritParams withr::with_options
#'
#' @export
with_recovery <- function(code){
    old <- options(error=recovery)
    on.exit(set_options(old))
    force(code)
}
halpo/recovery documentation built on Jan. 18, 2020, 12:16 a.m.