trythat retries on failure
This is useful for functions that are "flaky", such as
curl, which may fail for unknown
reasons that do not persist.
retry( expr, envir = parent.frame(), retries = 5, exponentialDecayBase = 1.3, silent = TRUE, exprBetween = NULL, messageFn = message )
Quoted expression to run, i.e.,
The environment in which to evaluate the quoted expression, default
Numeric. The maximum number of retries.
Numeric > 1.0. The delay between
successive retries will be
runif(1, min = 0, max = exponentialDecayBase ^ i - 1)
i is the retry number (i.e., follows
Logical indicating whether to
Another expression that should be run after a failed attempt
expr. This should return a named list, where the names indicate the object names
to update in the main expr, and the return value is the new value. (previous versions allowed
a non-list return, but where the final line had to be an assignment operator,
specifying what object (that is used in
expr) will be updated prior to running
expr again. For backwards compatibility, this still works).
A function for messaging to console. Defaults to
try, so the successfully returned
return() from the
expr or a