Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A promise version of Sentry.captureError.
'use strict'
const Raven = require('raven')
exports.capture = function (err, options = {}) {
return new Promise((resolve, reject) => {
const client = new Raven.Client(RAVEN_DSN)
const listener = res => {
client.removeListener('logged', listener)
client.once('logged', listener)
.once('error', err => {
client.removeListener('logged', listener)
client.captureError(err, options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment