An open API service indexing awesome lists of open source software.

https://github.com/articulate/paperplane-airbrake

An airbrake wrapper for paperplane.
https://github.com/articulate/paperplane-airbrake

airbrake paperplane

Last synced: 3 months ago
JSON representation

An airbrake wrapper for paperplane.

Awesome Lists containing this project

README

        


paperplane-airbrake



An airbrake wrapper for paperplane.



npm version npm downloads Build Status Coverage Status

## Usage

```haskell
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`.

```js
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](https://github.com/articulate/paperplane-airbrake/tree/v0.0.3). See the [`paperplane` migration guide](https://github.com/articulate/paperplane/blob/master/docs/migration-guide.md) for more details.