Create a condition

Usage

new_condition(message, call = NULL, class = NULL)
new_error(message, call = NULL, class = NULL)
new_warning(message, call = NULL, class = NULL)
new_message(message, call = NULL, class = NULL)

Arguments

message
character string.
call
call expression.
class
the classes from which the condition should inherit, in addition to the default classes.

Description

Allows the creation of basic and custom conditions, optionally overriding their class.

Examples

new_error("Something went wrong", class = "oops")
<oops: Something went wrong>