The type of signal depends on the class of the condition:
An interrupt is signalled if the condition inherits from
"interrupt". This is equivalent to signalling with
cnd_type() to determine the type of a condition.
cnd_signal(cnd, .cnd, .mufflable)
A condition object (see
These arguments are deprecated.
.cnd has been renamed to
cnd and is deprecated as of rlang 0.3.0.
.mufflable argument is deprecated as of rlang 0.3.0 and no
longer has any effect. Non-critical conditions are always
signalled with a muffle restart.
Creating a condition object with
cnd_signal() is deprecated as
of rlang 0.3.0. Please use
# The type of signal depends on the class. If the condition # inherits from "warning", a warning is issued: cnd <- warning_cnd("my_warning_class", message = "This is a warning") cnd_signal(cnd)#> Warning: This is a warning# If it inherits from "error", an error is raised: cnd <- error_cnd("my_error_class", message = "This is an error") try(cnd_signal(cnd))#> Error : This is an error