Learn R Programming

assertive.base (version 0.0-3)

assertionError: Condition classes

Description

Error, warning, and message classes derived from their simple equivalents.

Usage

assertionError(message, call = NULL)

assertionWarning(message, call = NULL)

assertionMessage(message, call = NULL)

Arguments

message
A string describing the problem.
call
A call describing the source of the condition.

Value

  • An object of class assertionError, assertionWarning, or assertionMessage.

Examples

Run this code
tryCatch(
  assert_all_are_true(FALSE),
  error = function(e)
  {
    if(inherits(e, "assertionCondition"))
    {
      # Handle assertions
      message("This is an assertion condition.")
    } else
    {
      # Handle other error types
    }
  }
)

Run the code above in your browser using DataLab