From 4acbe1ca2307252bf6eccef793820771d07fa17a Mon Sep 17 00:00:00 2001 From: brian-learningpool Date: Tue, 7 Apr 2015 09:32:28 +0100 Subject: [PATCH] Fix for "callback is not a function" error Also added some more logging. --- routes/download/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/download/index.js b/routes/download/index.js index b2da866f92..ae84b39b82 100644 --- a/routes/download/index.js +++ b/routes/download/index.js @@ -49,7 +49,10 @@ server.get('/download/:tenant/:course/:title/download.zip', function (req, res, fs.stat(downloadZipFilename, function(err, stat) { if (err) { - callback(err, 'Error calling fs.stat'); + logger.log('error', 'Error calling fs.stat'); + logger.log('error', error); + + next(err); } else { res.writeHead(200, { 'Content-Type': 'application/zip',