Takaro - v0.6.0
    Preparing search index...

    Variable setupKoaErrorHandlerConst

    setupKoaErrorHandler: (
        app: { use: (arg0: (ctx: any, next: any) => Promise<void>) => void },
    ) => void

    Add an Koa error handler to capture errors to Sentry.

    The error handler must be before any other middleware and after all controllers.

    Type Declaration

      • (app: { use: (arg0: (ctx: any, next: any) => Promise<void>) => void }): void
      • Parameters

        • app: { use: (arg0: (ctx: any, next: any) => Promise<void>) => void }

          The Express instances

        Returns void

    const Sentry = require('@sentry/node');
    const Koa = require("koa");

    const app = new Koa();

    Sentry.setupKoaErrorHandler(app);

    // Add your routes, etc.

    app.listen(3000);