Test moving Sentry
This commit is contained in:
parent
c6dc673ab5
commit
17b362654a
1 changed files with 9 additions and 6 deletions
15
app.js
15
app.js
|
@ -26,12 +26,6 @@ if (process.env.SENTRY_DSN) {
|
|||
dsn: process.env.SENTRY_DSN,
|
||||
release: process.env.GIT_REV,
|
||||
});
|
||||
app.on('error', (err) => {
|
||||
if (err.statusCode === 404) return;
|
||||
Sentry.captureException(err, (_err, eventId) => {
|
||||
debug('Reported error', eventId);
|
||||
});
|
||||
});
|
||||
app.context.Sentry = Sentry;
|
||||
}
|
||||
|
||||
|
@ -72,6 +66,15 @@ app.use(web.prefix('').routes());
|
|||
app.ws.use(redis.middleware());
|
||||
app.ws.use(ws.prefix('/api').routes());
|
||||
|
||||
app.on('error', (err) => {
|
||||
if (err.statusCode === 404) return;
|
||||
if (process.env.SENTRY_DSN) {
|
||||
Sentry.captureException(err, (_err, eventId) => {
|
||||
debug('Reported error', eventId);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (!module.parent) {
|
||||
app.listen(process.env.PORT || 4040, () => {
|
||||
debug('Koa HTTP server listening on port ', (process.env.PORT || 4040));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue