summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-12-04 15:19:24 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-12-04 15:19:24 +0100
commitdb1ba6a65e32ba6b4219d56f283dee2da7fa2db8 (patch)
tree2a37142b48ae0204196236aa55d801e9049a48e4
parente44b41f4a3e19a069e00983dd9d7616d62696aaa (diff)
downloadetherpad-lite-db1ba6a65e32ba6b4219d56f283dee2da7fa2db8.zip
Don't let express catch errors, let the process die
-rw-r--r--node/server.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/server.js b/node/server.js
index 08c09ab0..d42cf76e 100644
--- a/node/server.js
+++ b/node/server.js
@@ -98,6 +98,12 @@ async.waterfall([
app.use(express.cookieParser());
});
+ app.error(function(err, req, res, next){
+ res.send(500);
+ console.error(err.stack ? err.stack : err.toString());
+ gracefulShutdown();
+ });
+
//serve static files
app.get('/static/*', function(req, res)
{
@@ -110,6 +116,7 @@ async.waterfall([
//serve minified files
app.get('/minified/:id', function(req, res, next)
{
+ throw new Error();
res.header("Server", serverName);
var id = req.params.id;