log out errors more clearly

This commit is contained in:
Henry Oswald 2016-05-27 14:45:39 +01:00
parent 5ed6ef571f
commit 41ca3a4222
2 changed files with 6 additions and 2 deletions

View file

@ -22,7 +22,9 @@ module.exports = CompileManager =
timer = new Metrics.Timer("write-to-disk") timer = new Metrics.Timer("write-to-disk")
logger.log project_id: request.project_id, "starting compile" logger.log project_id: request.project_id, "starting compile"
ResourceWriter.syncResourcesToDisk request.project_id, request.resources, compileDir, (error) -> ResourceWriter.syncResourcesToDisk request.project_id, request.resources, compileDir, (error) ->
return callback(error) if error? if error?
logger.err err:error, project_id: request.project_id, "error writing resources to disk"
return callback(error)
logger.log project_id: request.project_id, time_taken: Date.now() - timer.start, "written files to disk" logger.log project_id: request.project_id, time_taken: Date.now() - timer.start, "written files to disk"
timer.done() timer.done()

View file

@ -13,7 +13,9 @@ module.exports = OutputFileFinder =
logger.log directory: directory, "getting output files" logger.log directory: directory, "getting output files"
OutputFileFinder._getAllFiles directory, (error, allFiles = []) -> OutputFileFinder._getAllFiles directory, (error, allFiles = []) ->
return callback(error) if error? if error?
logger.err err:error, "error finding all output files"
return callback(error)
jobs = [] jobs = []
outputFiles = [] outputFiles = []
for file in allFiles for file in allFiles