Takaro - v0.6.0
    Preparing search index...

    Function setupFastifyErrorHandler

    • Add an Fastify error handler to capture errors to Sentry.

      Parameters

      • fastify: FastifyMinimal

        The Fastify instance to which to add the error handler

      • Optionaloptions: Partial<FastifyHandlerOptions>

        Configuration options for the handler

      Returns void

      const Sentry = require('@sentry/node');
      const Fastify = require("fastify");

      const app = Fastify();

      Sentry.setupFastifyErrorHandler(app);

      // Add your routes, etc.

      app.listen({ port: 3000 });