paperplane-airbrake

0.1.0 • Public • Published

paperplane-airbrake

An airbrake wrapper for paperplane.

npm version npm downloads Build Status Coverage Status

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.

Readme

Keywords

none

Package Sidebar

Install

npm i paperplane-airbrake

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

6.77 kB

Total Files

7

Last publish

Collaborators

  • flintinatux
  • spencerfdavis