app: sentry track req

This commit is contained in:
DIYgod 2018-08-21 18:19:20 +08:00
parent ac42d919c5
commit d750ffa963
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 9 additions and 3 deletions

View File

@ -18,9 +18,15 @@ module.exports = async (ctx, next) => {
ctx.status = 404;
if (config.sentry) {
Raven.captureException(err, function(err, eventId) {
console.log('Reported error ' + eventId);
});
Raven.captureException(
err,
{
req: ctx.req,
},
function(err, eventId) {
console.log('Reported error ' + eventId);
}
);
}
}
};