mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Adjust nitpicks, remove whitespace in (), add around +
This commit is contained in:
parent
bec911f0a8
commit
3bf5f8b96c
1 changed files with 11 additions and 8 deletions
|
@ -33,19 +33,22 @@ for (var routeId in routes) {
|
|||
app.get(route.pattern, handler(route));
|
||||
}
|
||||
|
||||
if (typeof process.env.SENTRY_DSN === 'string' ) {
|
||||
if (typeof process.env.SENTRY_DSN === 'string') {
|
||||
var raven = require('raven');
|
||||
app.get( '/sentrythrow', function mainHandler () { throw new Error('Sentry Test'); } );
|
||||
app.get('/sentrythrow', function mainHandler () { throw new Error('Sentry Test'); });
|
||||
|
||||
// These handlers must be applied _AFTER_ other rotes have been applied
|
||||
app.use( raven.middleware.express.requestHandler( process.env.SENTRY_DSN ) );
|
||||
app.use( raven.middleware.express.errorHandler( process.env.SENTRY_DSN ) );
|
||||
app.use( function errorHandler (err, req, res, next) {
|
||||
res.append('X-Sentry-ID:'+res.sentry);
|
||||
// These handlers must be applied _AFTER_ other routes have been applied
|
||||
app.use(raven.middleware.express.requestHandler(process.env.SENTRY_DSN));
|
||||
app.use(raven.middleware.express.errorHandler(process.env.SENTRY_DSN));
|
||||
app.use(function errorHandler (err, req, res, next) {
|
||||
res.append('X-Sentry-ID:' + res.sentry);
|
||||
res.status(500);
|
||||
next(err);
|
||||
} );
|
||||
});
|
||||
|
||||
raven.patchGlobal(process.env.SENTRY_DSN, function () {
|
||||
process.exit(-1);
|
||||
});
|
||||
}
|
||||
|
||||
// Bind proxies in development
|
||||
|
|
Loading…
Reference in a new issue