egnha / valaddin

Functional input validation to make R functions more readable and robust
Other
33 stars 1 forks source link

Call in error message should print default arguments #33

Closed egnha closed 7 years ago

egnha commented 7 years ago

Currently, this happens:

f <- function(x, y = "1") NULL
firmly(f, ~is.numeric)(1)
#> Error: firmly(f, ~is.numeric)(x = 1)
#> FALSE: is.numeric(y)

The error message is correct, but needs to be more informative: the full call, including default values, should be included. (Otherwise, it is a bit mysterious as to what y is, if you don't have f right in front of you.)