Calls a function provided by the user and adds the function call to the error message if the call fails.
See also
Utilities used within Derivation functions:
extract_unit()
,
get_not_mapped()
,
signal_duplicate_records()
Examples
call_user_fun(compute_bmi(
height = 172,
weight = 60
))
#> [1] 20.28123
try(call_user_fun(compute_bmi(
height = 172,
weight = "hallo"
)))
#> Error in value[[3L]](cond) :
#> Calling compute_bmi(height = 172, weight = "hallo") caused the following error:
#> Error in `assert_numeric_vector()`:
#> ! `weight` must be a numeric vector but is `"hallo"`
#>