#' @include ErrorHandler.R
makeErrorHandler(
name = "ErrorHandlerFunction",
error_detector = function(error) {
stringi::stri_extract_first_regex(error, "(?<=could not find function \").*(?=\")")
},
error_solver = function(detection, confirm) {
objects = unlist(sapply(search()[-1],lsf.str))
if (length(match <- agrep(detection, objects))) {
message(sprintf("Maybe you meant: %s", paste(objects[match], collapse = ", ")))
}
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.