Description Usage Arguments Value Examples
Custom error handler for printing the name of an enclosing function with error
1 | func_error_handler(e, calling_func)
|
e |
A |
calling_func |
A character string naming the enclosing function (or closure) for printing with error messages |
NULL - throws error with custom message
1 2 3 4 5 6 7 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.