# NOT RUN {
logger.setup()
# Arbitrarily deep in the stack we might have:
myFunc <- function(x) {
a <- log(x)
}
userInput <- 10
result <- try({
myFunc(x=userInput)
}, silent=TRUE)
stopOnError(result)
userInput <- "ten"
result <- try({
myFunc(x=userInput)
}, silent=TRUE)
stopOnError(result)
result <- try({
myFunc(x=userInput)
}, silent=TRUE)
stopOnError(result, "Unable to process user input")
# }
Run the code above in your browser using DataCamp Workspace