purely: Capture all errors, warnings and messages.
Description
Capture all errors, warnings and messages.
Usage
purely(.f, strict = 2)
Value
A function which returns a list. The first element of the list, `$value`,
is the result of the original function `.f` applied to its inputs. The second element, `$log` is
`NULL` in case everything goes well. In case of error/warning/message, `$value` is NA and `$log`
holds the message. `purely()` is used by `record()` to allow the latter to handle errors.
Arguments
.f
A function to decorate.
strict
Controls if the decorated function should catch only errors (1), errors and
warnings (2, the default) or errors, warnings and messages (3).