From c0264253f7b7e0e52f4033459b9bd379817c278f Mon Sep 17 00:00:00 2001 From: Joe Brady Date: Mon, 5 Jun 2017 15:05:54 +0100 Subject: [PATCH] Add error catching (#29) --- server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.js b/server.js index bb766e8..c8c3489 100644 --- a/server.js +++ b/server.js @@ -49,3 +49,9 @@ app.use('/', mds.middleware({ rootDirectory: path.resolve(__dirname, ''), view: 'layout' })); + +// eslint-disable-next-line no-unused-vars +app.use(function (err, req, res, next) { + console.error(err.stack) + res.status(500).send('Error - please try again or raise an issue at https://github.com/AdoptOpenJDK/openjdk-api/issues.') +});