Error handler with Sentry reporting

sentry_error_handler(req, res, error, ...)

Arguments

req

a plumber request object

res

a plumber response object

error

an error object

...

extra named variables for Sentry

Value

a list with response payload

Examples

if (FALSE) { sentryR::configure_sentry(Sys.getenv("SENTRY_DSN")) pr <- plumber::plumb("example_plumber.R") pr$setErrorHandler(sentryR::sentry_error_handler) pr$run() }