R/error_handler.R

Defines functions error_handler

# Gracefully handle Plumber errors so they are effectively communicated back to
# Tableau
# @param req Plumber \code{req} object
# @param res Plumber \code{res} object
# @param err An error object passed from Plumber
error_handler <- function(req, res, err) {
  res$status <- 500
  list(
    message = jsonlite::unbox("Server Error"),
    info = jsonlite::unbox(conditionMessage(err))
  )
}

Try the plumbertableau package in your browser

Any scripts or data that you put into this service are public.

plumbertableau documentation built on Aug. 6, 2021, 9:05 a.m.