Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

adonis-raven

1.0.1 • Public • Published

adonis-sentry

Sentry provider for AdonisJS

npm version Build status GitHub license

Install

adonis install adonis-raven

You need to add the provider to AdonisJS at start/app.js:

const providers = [
   ...
   'adonis-raven/providers/Sentry',
];

and in your .env file

SENTRY_DNS=

then you can use it as

const sentry = use('Sentry')

if you want to catch all the exceptions of your adonis project you must create an exception handler

adonis make:ehandler

and we need add sentry notify in app/Exceptions/Handler.js

'use strict'
 
const sentry = use('Sentry')
 
class ExceptionHandler {
 
  ...
 
  async report (error, { request }) {
    sentry.captureException(error)
  }
}
 
module.exports = ExceptionHandler
 

Official documentation for Node.js apps

https://docs.sentry.io/clients/node/

Issues & PR

It is always helpful if we try to follow certain practices when creating issues or PR's, since it will save everyone's time.

  1. Always try creating regression tests when you find a bug (if possible).
  2. Share some context on what you are trying to do, with enough code to reproduce the issue.
  3. For general questions, please create a forum thread.
  4. When creating a PR for a feature, make sure to create a parallel PR for docs too.

License

Adonis Sentry is open-sourced software licensed under the MIT license.

Install

npm i adonis-raven

DownloadsWeekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

7.14 kB

Total Files

12

Last publish

Collaborators

  • avatar