Error handler with Sentry reporting
sentry_error_handler(req, res, error, ...)
req | a plumber request object |
---|---|
res | a plumber response object |
error | an error object |
... | extra named variables for Sentry |
a list with response payload
if (FALSE) { sentryR::configure_sentry(Sys.getenv("SENTRY_DSN")) pr <- plumber::plumb("example_plumber.R") pr$setErrorHandler(sentryR::sentry_error_handler) pr$run() }