Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

airbrake-mini-client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airbrake-mini-client - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "airbrake-mini-client",
"version": "0.0.1",
"version": "0.0.2",
"description": "A lightweight alternative to airbrake-js.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -30,2 +30,13 @@ # airbrake-mini-client

### Notify additional parameters
```js
airbrakeMini.notify({
error: new Error('BOOM'),
context: { severity: 'warning' }
params: {}, // put here any field you want
environment: {}, // put here any field you want
session: {} // put here any field you want
})
```
### Configuration

@@ -32,0 +43,0 @@ AirbrakeMini constructor takes the following mandatory parameter:

@@ -0,1 +1,2 @@

var objectAssign = require('object-assign')
var Reporter = require('./reporter')

@@ -27,3 +28,6 @@ var stacktrace = require('./stacktrace')

} else {
payload.errors = [err]
payload.errors = [stacktrace(err.error)]
objectAssign(payload.context, err.context || {})
objectAssign(payload.params, err.params || {})
objectAssign(payload.session, err.session || {})
}

@@ -30,0 +34,0 @@ this.reporter.notify(payload)

@@ -105,5 +105,5 @@ /* eslint-env browser */

req.send(enrichedPayload)
req.send(JSON.stringify(enrichedPayload))
}
module.exports = Reporter

@@ -31,2 +31,10 @@ /* eslint-env browser, mocha */

})
it('notifies using an object', () => {
airbrake.notify({ error: new Error('BOOM!'), context: { severity: 'warning' } })
assert.isTrue(reporter.notify.calledOnce)
var payload = reporter.notify.args[0][0]
assert.equal(payload.id, '')
assert.deepEqual(payload.context, { severity: 'warning', windowError: false, history: [] })
})
})

@@ -47,4 +47,4 @@ /* eslint-env browser, mocha */

assert.equal(requests[0].method, 'POST')
assert.equal(requests[0].requestBody.test, 1)
assert.equal(JSON.parse(requests[0].requestBody).test, 1)
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc