if.error: expressions/values conditional on whether tested expression returns an error.
Description
Does a given expression return an error?
Return specific values/expressions for either case.
Useful for loops when you want to easily control values based on errors that arise.
Usage
if.error(expr, error_true, error_false)
Arguments
expr
Expression to be tested for returning an error.
error_true
Value or expression to be executed if tested expression returns an error.
error_false
Value or expression to be executed if tested expression does not return an error.
Value
Returns value or expression stated in error_true or error_false,
depending on whether the tested expression throws an error.