Add request context to Sentry errors
This commit is contained in:
parent
5ba3016557
commit
78df53d569
1 changed files with 7 additions and 2 deletions
9
app.js
9
app.js
|
@ -38,9 +38,14 @@ if (process.env.NODE_ENV === 'production') {
|
|||
app.proxy = true;
|
||||
}
|
||||
|
||||
app.on('error', (err) => {
|
||||
app.on('error', (err, ctx) => {
|
||||
if (!err.status || err.status >= 500) {
|
||||
Sentry.captureException(err);
|
||||
Sentry.withScope(function(scope) {
|
||||
scope.addEventProcessor(function(event) {
|
||||
return Sentry.Handlers.parseRequest(event, ctx.request);
|
||||
});
|
||||
Sentry.captureException(err);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue