File: try_error.Rd

package info (click to toggle)
r-cran-xfun 0.37%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 792 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 473 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{try_error}
\alias{try_error}
\title{Try an expression and see if it throws an error}
\usage{
try_error(expr)
}
\arguments{
\item{expr}{An R expression.}
}
\value{
\code{TRUE} (error) or \code{FALSE} (success).
}
\description{
Use \code{\link{tryCatch}()} to check if an expression throws an error.
}
\examples{
xfun::try_error(stop("foo"))  # TRUE
xfun::try_error(1:10)  # FALSE
}