Skip to content

Commit

Permalink
use tryCatch again, to capture warnings as well
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 30, 2022
1 parent 20c12de commit 68d1a1e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/data_match.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ data_filter <- function(x, filter, ...) {
if (is.character(condition)) {
condition <- .str2lang(condition)
}
out <- try(do.call(subset, list(x, subset = condition)), silent = TRUE)
if (inherits(out, "try-error")) {
out <- NULL
}

out <- tryCatch(
do.call(subset, list(x, subset = condition)),
warning = function(e) NULL,
error = function(e) NULL
)
# any errors? Give more informative message to users
# about possible misspelled comparisons / logical conditions
if (is.null(out)) {
Expand Down

0 comments on commit 68d1a1e

Please sign in to comment.