Send regular errors to Sentry

This commit is contained in:
Jonathan Cremin 2019-01-13 22:32:48 +00:00
parent 8c69700b7f
commit 9fcec67a5b

5
app.js
View file

@ -22,6 +22,11 @@ app.keys = [process.env.COOKIE_KEY];
if (process.env.SENTRY_DSN) { if (process.env.SENTRY_DSN) {
Raven.config(process.env.SENTRY_DSN); Raven.config(process.env.SENTRY_DSN);
Raven.install(); Raven.install();
app.on('error', function (err) {
Raven.captureException(err, function (err, eventId) {
console.log('Reported error ' + eventId);
});
});
app.use(async (ctx, next) => { app.use(async (ctx, next) => {
ctx.Raven = Raven; ctx.Raven = Raven;
await next(); await next();