Add a Hapi plugin to capture errors to Sentry.
The Hapi server to attach the error handler to
const Sentry = require('@sentry/node');const Hapi = require('@hapi/hapi');const init = async () => { const server = Hapi.server(); // all your routes here await Sentry.setupHapiErrorHandler(server); await server.start();}; Copy
const Sentry = require('@sentry/node');const Hapi = require('@hapi/hapi');const init = async () => { const server = Hapi.server(); // all your routes here await Sentry.setupHapiErrorHandler(server); await server.start();};
Add a Hapi plugin to capture errors to Sentry.