on_error {attempt}R Documentation

Add a function to be run on error

Description

This function behaves as 'on.exit()', but is run on error, and supports mappers.

Usage

on_error(f)

Arguments

f

a function to call on error

Value

A local error handler.

Examples


y <- function(num){
  on_error(~ write( Sys.time(), "error_log.txt", append = TRUE) )
  log(num)
}


[Package attempt version 0.3.1 Index]