Fixed bug causing request/response logs to not be written to disk

This commit is contained in:
Zaid Abdulla committed 2012-12-20 23:52:45 +03:00
1 parent de7a74437a
commit 20992e8630
1 file changed
+2 -4
+2 -4
View File
@@ -132,18 +132,16 @@ if cluster.isMaster
cluster.fork()
else
if config.DEBUG
process.on('uncaughtException', (err) ->
process.on('uncaughtException', (error) ->
# dump request/response logs and stack trace
util.log("Unexpected error occured. Writing log to debug/#{currentClientIP}.log.")
memcached.get("debug-#{currentClientIP}", (err, l) ->
util.error(err) if err
fs = require 'fs'
fs.writeFile("debug/#{currentClientIP}.log", l + "\n\n" + err.stack, (err) ->
util.error(err) if err
fs.writeFileSync("debug/#{currentClientIP}.log", l + "\n\n" + error.stack)
process.exit(1)
)
)
)
server = http.createServer (request, response) ->
if request.method != 'POST'