For call stacks that span multiple packages, this can give the impression that errors are raised through the surface-level package when they were actually raised by a dependency.
Whether this is intended or not, the option to specify a call provided to reportAssertions would be a nice addition in order to make the error reporting communicate the location where the assertions are raised.
I'm not sure if this is intentional, but it's a bit confusing.
Raising assertions in
x
, I would expect that the error message's call originates fromx
:Instead, the error is reported as originating in
y()
.This occurs because the top level call (
sys.call(1L)
) is used for the error condition instead of the calling frame (sys.call(-1L)
)https://github.com/mllg/checkmate/blob/5e35f452229b2a37536a4e21e1a6b6763fa45dc3/R/AssertCollection.R#L57
For call stacks that span multiple packages, this can give the impression that errors are raised through the surface-level package when they were actually raised by a dependency.
Whether this is intended or not, the option to specify a call provided to
reportAssertions
would be a nice addition in order to make the error reporting communicate the location where the assertions are raised.