composerr_ {labelmachine} | R Documentation |
Compose error handlers (concatenate error messages)
Description
The functions composerr()
, composerr_()
and composerr_parent()
modify error handlers by
appending character strings to the error messages of the error handling
functions:
-
composerr()
uses non-standard evaluation. -
composerr_()
is the standard evaluation alternative ofcomposerr()
. -
composerr_parent()
is a wrapper ofcomposerr()
, defining the parent environment as the lookup environment of theerr_handler
. This function looks up the prior error handling function in the parent environment of the current environment and allows you to store the modified error handling function under the same name as the error handling function from the parent environment without running into recursion issues. This is especially useful when doing error handling in nested environments (e.g. checking nested list objects) and you don not want to use different names for the error handling functions in the nested levels. If you don't have a nested environment situation, better usecomposerr()
orcomposerr_()
.
Usage
composerr_(text_1 = NULL, err_prior = NULL, text_2 = NULL,
sep_1 = ": ", sep_2 = ": ", env_prior = parent.frame())
composerr(text_1 = NULL, err_prior = NULL, text_2 = NULL,
sep_1 = ": ", sep_2 = ": ", env_prior = parent.frame())
composerr_parent(text_1 = NULL, err_prior = NULL, text_2 = NULL,
sep_1 = ": ", sep_2 = ": ", env_prior = parent.frame())
Arguments
text_1 |
A character string, which will be appended
at the beginning of the error message. The argument |
err_prior |
There are three valid types:
|
text_2 |
A character string, which will be appended
at the end of the error message. The argument |
sep_1 |
A character string that is used as separator for the
concatenation of |
sep_2 |
A character string that is used as separator for the
concatenation of |
env_prior |
An environment where the error handling function given in
|
Value
A new error handling function that has an extended error message.