A wrapper around base try that allows you to set a custom message when an error/warning occurs.
attempt
returns the value if there are no errors or messages.
attempt(expr, msg = NULL, verbose = FALSE, silent = FALSE)
if (FALSE) { # \dontrun{
attempt(log("a"), msg = "Nop !")
} # }