From 9fcec67a5b1635387e8e820d6ce65808510ed6de Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sun, 13 Jan 2019 22:32:48 +0000 Subject: [PATCH] Send regular errors to Sentry --- app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.js b/app.js index 4926006..d6261ef 100644 --- a/app.js +++ b/app.js @@ -22,6 +22,11 @@ app.keys = [process.env.COOKIE_KEY]; if (process.env.SENTRY_DSN) { Raven.config(process.env.SENTRY_DSN); Raven.install(); + app.on('error', function (err) { + Raven.captureException(err, function (err, eventId) { + console.log('Reported error ' + eventId); + }); + }); app.use(async (ctx, next) => { ctx.Raven = Raven; await next();