throw {box} | R Documentation |
Throw informative error messages
Description
Helpers to generate readable and informative error messages for package users.
Usage
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)
Arguments
... |
arguments to be passed to |
call |
the calling context from which the error is raised |
subclass |
an optional subclass name for the error condition to be raised |
error |
an object of class |
expr |
an expression to evaluate inside |
message |
the error message |
Details
For rethrow
, the call
argument overrides the rethrown error’s
own stored call.
Value
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.
[Package box version 1.2.0 Index]