octoblu-raven
v6.0.2
Published
Raven Error handling for Octoblu Services and workers.
Downloads
74
Readme
node-octoblu-raven
Raven Error handling for Octoblu Services and Workers.
Installation
npm install --save octoblu-raven
Usage
Configuration Environment
Recommended:
env SENTRY_DSN='the-sentry-dsn'
Optional:
const options = {
dsn: 'the-sentry-dsn',
logFn: function() {}
}
new OctobluRaven(options)
NOTE: if no DSN is provided, it default to normal behavior and will not log with sentry
Express
!IMPORTANT: As of v4.0.0 use the new expressBundle method since it makes everyones life easier.
There is no longer a need for including express-send-error since that is included in the bundle.
For use with express apps.
express = require 'express'
OctobluRaven = require 'octoblu-raven'
app = express()
new OctobluRaven().handleExpress({ app })
Catch Uncaught Exceptions
Use at the root the project, typically in ./command.js
. This can be used independently or with the use of the Express Middleware.
OctobluRaven = require 'octoblu-raven'
new OctobluRaven().patchGlobal()
Report Error, or Message
Use this to manually report an error or message to Sentry.
OctobluRaven = require 'octoblu-raven'
octobluRaven = new OctobluRaven()
octobluRaven.reportError(new Error('oh no'))