# empty condition
x <- new_condition("informative error message", class = "foo")
try(stop(x))
# with pkg
x <- new_condition("msg", class = "foo", pkg = "bar")
# class contains multiple identifiers, including a "bar:fooError"
class(x)
# message contains package information at the end
try(stop(x))
Run the code above in your browser using DataLab