0.1.0 • Published 6 years ago

paperplane-airbrake v0.1.0

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

Usage

cry :: Airbrake -> Error -> Promise Error

Constructs a cry error-handler for paperplane to populate the airbrake notification with request details, similar to the built-in express and hapi handlers for airbrake.

const Airbrake  = require('airbrake')
const http      = require('http')
const { mount } = require('paperplane')

const airbrake = Airbrake.createClient(
  process.env.AIRBRAKE_PROJECT_ID,
  process.env.AIRBRAKE_API_KEY,
  process.env.APP_ENV
)

const app = () => { throw new Error('uh oh') }

const cry = require('paperplane-airbrake')(airbrake)

http.createServer(mount({ app, cry })).listen(3000)

Note: This version of paperplane-airbrake supports paperplane v2. For paperplane v1, you will need paperplane-airbrake v0.0.3. See the paperplane migration guide for more details.

0.1.0

6 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago