on_error: Add a function to be run on error

Description Usage Arguments Value Examples

View source: R/on_error.R

Description

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

Usage

1

Arguments

f

a function to call on error

Value

A local error handler.

Examples

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

attempt documentation built on May 4, 2020, 1:05 a.m.