Send regular errors to Sentry
This commit is contained in:
parent
8c69700b7f
commit
9fcec67a5b
1 changed files with 5 additions and 0 deletions
5
app.js
5
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue