Add an Fastify error handler to capture errors to Sentry.
The Fastify instance to which to add the error handler
Optional
Configuration options for the handler
const Sentry = require('@sentry/node');const Fastify = require("fastify");const app = Fastify();Sentry.setupFastifyErrorHandler(app);// Add your routes, etc.app.listen({ port: 3000 }); Copy
const Sentry = require('@sentry/node');const Fastify = require("fastify");const app = Fastify();Sentry.setupFastifyErrorHandler(app);// Add your routes, etc.app.listen({ port: 3000 });
Add an Fastify error handler to capture errors to Sentry.