Skip to content

Commit

Permalink
add overall error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Jucker committed Jun 3, 2019
1 parent f528eaa commit e742b7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ app.use(morgan('combined', {
app.get('/healthz', healthz.run);
app.get('/auth', userAuthentication.run);
app.post('/token', bodyParser.json(), tokenAuthentication.run);
app.use((err, req, res, next) => {
logger.error(err);
res.sendStatus(500);
});

export default app;

0 comments on commit e742b7d

Please sign in to comment.