From 68d1a1e6c73dd968f1f4f08f5c651cd8b55351f1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 30 Aug 2022 17:22:22 +0200 Subject: [PATCH] use tryCatch again, to capture warnings as well --- R/data_match.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/data_match.R b/R/data_match.R index 759dc1cb1..e663e44ec 100644 --- a/R/data_match.R +++ b/R/data_match.R @@ -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)) {