composerr_helper: Helper function for 'composerr()'

View source: R/composerr.R

composerr_helperR Documentation

Helper function for composerr()

Description

Helper function for composerr()

Usage

composerr_helper(before, err_h, after, collapse, action, err_h_usage)

Arguments

before

Optional string that will be prepended to the error message msg, when the resulting error handler is called.

err_h

Optional parent error handler. It must either be NULL or a composerr class object created with the function composerr(). If err_h is omitted, then composerr() creates a new error handler from scratch. Otherwise, the error handler passed to err_h is used as parent error handler for the creation of the new error handler.

after

Optional string that will be appended to the error message msg, when the resulting error handler is called.

collapse

Optional string that will be used for collapsing the resulting error message paste0(before, msg, after), when the resulting error handler is called. If collapse is set to NULL, then the resulting error message will not be collapsed, but directly be passed on.

action

Optional default ultimate error handler. This argument can either be NULL (no default handler defined) or a function function(msg, ...). In the latter case this defines a default function that will be used as ultimate error handler if the current error handler is called without passing an action argument. The used ultimate error handler is passed down the error handler cascade until it ultimately will be called in order to process the successively extended error message (e.g. throw an error or a warning or do something else with the created error message). The argument action can be used, in order to change the default behavior of the error processing to throwing a warning (action = warning) or some other customized behavior like writing the error message to a text file (action = function(msg, ...) cat(msg, file = FILENAME, fill = TRUE)).

err_h_usage

An error handling function for catching errors because of improper usage of composerr_helper().


a-maldet/composerr documentation built on Oct. 29, 2022, 8:05 p.m.