Errors of class
conditionMessage()methods for subclasses of
"rlang_error"is undefined behaviour. Instead, implement the
cnd_header()method (and possibly
cnd_footer()). These methods return character vectors which are assembled by rlang when needed: when
conditionMessage.rlang_error()is called (e.g. via
try()), when the error is displayed through
format(), and of course when the error is displayed to the user by
cnd_footer()methods can be overridden by storing closures in the
footerfields of the condition. This is useful to lazily generate messages based on state captured in the closure environment.
In this case, the
messagefield may be a character vector of header and bullets. These are formatted at the last moment to take the context into account (starting position on the screen and indentation).