if (FALSE) {
handler_error <- function(req, res, err){
res$status <- 500
list(error = "Custom Error Message")
}
pr() %>%
pr_get("/error", function() log("a")) %>%
pr_set_error(handler_error) %>%
pr_run()
}
Run the code above in your browser using DataLab