Closed egnha closed 7 years ago
And update %secure%
, accordingly:
`%secure%` <- function(args, f) {
nms <- names(args) %||% character(length(args))
firmly(
f,
.checklist = args[!nms %in% c(".warn_missing", ".error_class")],
.warn_missing = args[[".warn_missing"]] %||% character(),
.error_class = args[[".error_class"]] %||% character()
)
}
(No need for %secure%
to check types, since firmly()
will do that for itself.)
If an input validation error occurs,
firmly
signals asimpleError
. For more discriminating error handling downstream,firmly
should be allowed to signal other classes of errors. In other words,firmly
should have a character-vector parameter.error_class
that gives the subclass of the condition, inheriting fromc("error", "condition")
(default value"simpleError"
), that is to be signaled by an input validation error.New signature should be