added more logging when an error is passed to next, specifically useful for debugging csrf stuff

This commit is contained in:
Henry Oswald
2014-04-02 12:44:52 +01:00
parent bd118a57c2
commit f3ad7e10cd

View File

@@ -14,7 +14,7 @@ argv = require("optimist")
.argv
Server.app.use (error, req, res, next) ->
logger.error err: error
logger.error err: error, url:req.url, method:req.method, user:req?.sesson?.user, "error passed to top level next middlewear"
res.statusCode = error.status or 500
if res.statusCode == 500
res.end("Oops, something went wrong with your request, sorry. If this continues, please contact us at team@sharelatex.com")