purely: Capture all errors, warnings and messages

View source: R/loudly.R

purelyR Documentation

Capture all errors, warnings and messages

Description

Capture all errors, warnings and messages

Usage

purely(.f)

Arguments

.f

A function to decorate

Value

A function which returns a list. The first element of the list, $result, 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, $result is NA and and $log holds the message. purely() is used by loudly() to allow the latter to handle errors.

Examples

purely(log)(10)
purely(log)(-10)

b-rodrigues/loud documentation built on April 8, 2022, 12:32 p.m.