func_error_handler {pipeliner}R Documentation

Custom error handler for printing the name of an enclosing function with error

Description

Custom error handler for printing the name of an enclosing function with error

Usage

func_error_handler(e, calling_func)

Arguments

e

A simpleError - e.g. thrown from tryCatch

calling_func

A character string naming the enclosing function (or closure) for printing with error messages

Value

NULL - throws error with custom message

Examples

## Not run: 
f <- function(x) x ^ 2
tryCatch(f("a"), error = function(e) func_error_handler(e, "f"))
# Error in x^2 : non-numeric argument to binary operator
# ---> called from within function: f

## End(Not run)

[Package pipeliner version 0.1.1 Index]