This utility function checks if an error exists and, if so, appends it to the provided error list.
Usage
add_to_errors(errors, err)
Arguments
- errors
A list object that contains the current errors.
- err
An error object to be added to the error list. It can be NULL, in which case no action is taken.
Value
The updated errors list.
Examples
if (FALSE) { # \dontrun{
errors <- list()
new_error <- list(description = "Some error") # Hypothetical error structure.
errors <- add_to_errors(errors, new_error)
} # }