if (FALSE) {
myFunc <- function(x) {
log(x)
}
result <- try({
myFunc("ten")
}, silent = TRUE)
stopOnError(result)
try({
myFunc("ten")
}, silent = TRUE) %>%
stopOnError(err_msg = "Unable to process user input")
try({
myFunc("ten")
}, silent = TRUE) %>%
stopOnError(
prefix = "USER_INPUT_ERROR",
maxLength = 40,
truncatedLength = 32
)
}
Run the code above in your browser using DataLab