Use tryCatch() to check if an expression throws an error.
Examples
xfun::try_error(stop("foo")) # TRUE
#> [1] TRUE
xfun::try_error(1:10) # FALSE
#> [1] FALSE
Use tryCatch() to check if an expression throws an error.
xfun::try_error(stop("foo")) # TRUE
#> [1] TRUE
xfun::try_error(1:10) # FALSE
#> [1] FALSE