Wondering what’s next for npm?Check out our public roadmap! »

    koa-raven

    3.1.1 • Public • Published

    NOTICE

    Sentry now provides official Koa integration: https://sentry.io/for/koa/.

    koa-raven

    raven middleware for koa.

    Install

    $ npm i koa-raven --save

    Usage

    raven(DSN[, opts])

    const raven = require('koa-raven')
    const Koa = require('koa')
    const app = new Koa()
     
    app.use(raven('DSN', opts))
     
    app.use((ctx) => {
      throw new Error('test')
    })
     
    app.listen(3000)

    or:

    const raven = require('koa-raven')
    const Koa = require('koa')
    const app = new Koa()
     
    app.use(raven('DSN', opts))
     
    app.use((ctx) => {
      try {
        throw new Error('test')
      } catch (e) {
        ctx.raven.captureException(e, { extra: { name: 'tom' } })
        ctx.status = 500
        ctx.body = e.stack
      }
    })
     
    app.listen(3000)

    Options

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

    License

    MIT

    Install

    npm i koa-raven

    DownloadsWeekly Downloads

    0

    Version

    3.1.1

    License

    MIT

    Unpacked Size

    2.65 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar