Checks if an object is of class “try-error” or “error”.
is.error(x)
x
[any] Any object, usually the return value of try, tryCatch, or a function which may return a simpleError.
try
tryCatch
simpleError
[logical(1)].
logical(1)
x = try(stop("foo")) print(is.error(x))
## [1] TRUE
x = 1 print(is.error(x))
## [1] FALSE