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.
- Host: GitHub
- URL: https://github.com/articulate/paperplane-airbrake
- Owner: articulate
- License: mit
- Created: 2017-03-29T15:11:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T03:51:53.000Z (almost 7 years ago)
- Last Synced: 2025-02-27T06:15:56.256Z (4 months ago)
- Topics: airbrake, paperplane
- Language: JavaScript
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 67
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
paperplane-airbrake
Anairbrake
wrapper forpaperplane
.
## 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.