This is a lightweight client for airbrake (airbrake.io). The goal of this implementation is to provide a simpler and less invasive logging feature.
Create an instance
var AirbrakeMini =var airbrakeMini = // projectId and projectKey are provided by airbrake
Notify an error
try// critical codecatch eairbrakeMini
Notify additional parameters
AirbrakeMini constructor takes the following mandatory parameter:
I strongly suggest to provide this optional parameter:
- environment: 'local', 'staging', 'development', 'live'
These other paramenters are mostly for testing:
- timeout: timeout for XMLHttpRequest
- host: it defaults to airbrake host
- reporter: an object providing a "notify" method
- win: the window global object (default to the current window)
You can use this feature to avoid sending an error to the server if it matches some criteria. You can also use this function to enrich the notice with specific informations. You can add as many filters you want. The method is chainable.
Here's some example: