R/isTryError.R

Defines functions isTryError

Documented in isTryError

#' Does an Object Inherit from "try-error"?
#'
#' @param x R object
#' @return logical of length one, TRUE if \code{x} inherits from "try-error",
#'   otherwise FALSE
#' @export
#' @examples
#' result <- try(stop("Stop!"), silent = TRUE)
#' isTryError(result) # TRUE
isTryError <- function(x)
{
  inherits(x, "try-error")
}
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.