Debian Codegraph @

man/try_error.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/utils.R
3 \name{try_error}
4 \alias{try_error}
5 \title{Try an expression and see if it throws an error}
6 \usage{
7 try_error(expr)
8 }
9 \arguments{
10 \item{expr}{An R expression.}
11 }
12 \value{
13 \code{TRUE} (error) or \code{FALSE} (success).
14 }
15 \description{
16 Use \code{\link[=tryCatch]{tryCatch()}} to check if an expression throws an error.
17 }
18 \examples{
19 xfun::try_error(stop("foo")) # TRUE
20 xfun::try_error(1:10) # FALSE
21 }