Helpers to generate readable and informative error messages for package users.
throw(..., call = sys.call(sys.parent()), subclass = NULL)rethrow(error, call = sys.call(sys.parent()))
rethrow_on_error(expr, call = sys.call(sys.parent()))
box_error(message, call = NULL, subclass = NULL)
If it does not throw an error, rethrow_on_error
returns the
value of evaluating expr
.
box_error
returns a new ‘box’ error condition object
with a given message and call, and optionally a given subclass type.
arguments to be passed to fmt
the calling context from which the error is raised
an optional subclass name for the error condition to be raised
an object of class c("error", "condition")
to rethrow
an expression to evaluate inside tryCatch
the error message
For rethrow
, the call
argument overrides the rethrown error’s
own stored call.