catch_cnd {rlang} | R Documentation |
This is a small wrapper around tryCatch()
that captures any
condition signalled while evaluating its argument. It is useful for
debugging and unit testing.
catch_cnd(expr)
expr |
Expression to be evaluated with a catch-all condition handler. |
A condition if any was signalled, NULL
otherwise.
catch_cnd(10) catch_cnd(abort("an error")) catch_cnd(cnd_signal("my_condition", .msg = "a condition"))