0.1.4 • Published 8 months ago

@kubit/sentry v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@kubit/sentry

Sentry for Adonis/Kubit applications.

Getting Started

Install

npm i @kubit/sentry @sentry/node @sentry/profiling-node

Configure

node ace configure @kubit/sentry

Usage

To utilize this package, just open up app/Exceptions/Handler.ts and add the following:

import HttpExceptionHandler from '@ioc:Adonis/Core/HttpExceptionHandler';
import Logger from '@ioc:Adonis/Core/Logger';
+ import Sentry from '@ioc:Kubit/Sentry';

export default class ExceptionHandler extends HttpExceptionHandler {
  protected statusPages = {
    '403': 'errors/unauthorized',
    '404': 'errors/not-found',
    '500..599': 'errors/server-error',
  };

  constructor() {
    super(Logger);
  }

+  public async handle(error: any, ctx: HttpContextContract) {
+    Sentry.captureException(error);

+    return super.handle(error, ctx);
+  }
}

For additional details about Sentry's API, check the SDK documentation.

For more information about Kubit, visit kubitjs.com!

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago