diff --git a/NEWS.md b/NEWS.md index 17a01502..91a31fc9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ ## Updates of Existing Functions +* Updated `assertions_filter_cond` by adding a `gsub()` argument on line 520 so that error messages return `filter_add` instead of `enexpr(filter_add)`. + * Error messaging throughout the package have been updated from `rlang::abort()` to `cli::cli_abort()`. As a part of the update, each of the `assert_*()` functions have new arguments `assert_*(message, arg_name, call, class).` (#367) * Warning messaging has also been updated to use `{cli}` messaging. diff --git a/R/assertions.R b/R/assertions.R index 8d2f20cd..13ec1c7c 100644 --- a/R/assertions.R +++ b/R/assertions.R @@ -517,6 +517,8 @@ assert_filter_cond <- function(arg, return(invisible(arg)) } + arg_name <- gsub("^.*\\((.*)\\)$", "\\1", arg_name) + provided <- !is_missing(arg) if (provided && !(is_call(arg) || is_logical(arg))) { cli_abort(