Learn R Programming

climatehealth (version 1.0.0)

is_climate_error: Check if an error is a climate_error

Description

Utility function to check if a caught condition is a typed climate error.

Usage

is_climate_error(error)

Value

TRUE if the error inherits from "climate_error", FALSE otherwise.

Arguments

error

A condition object

Examples

Run this code
# \donttest{
tryCatch({
  stop("example error")
}, error = function(e) {
  if (is_climate_error(e)) {
    # Handle structured error
  } else {
    # Handle untyped error
  }
})
# }

Run the code above in your browser using DataLab