Explorar el Código

added try catch around word count where a file is not created

Henry Oswald hace 11 años
padre
commit
253a99e780
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      services/clsi/app/coffee/CompileManager.coffee

+ 6 - 1
services/clsi/app/coffee/CompileManager.coffee

@@ -120,7 +120,12 @@ module.exports = CompileManager =
 
 		CommandRunner.run project_id, command, directory, timeout, (error) ->
 			return callback(error) if error?
-			stdout = fs.readFileSync(directory + "/" + file_name + ".wc", "utf-8")
+			try
+				stdout = fs.readFileSync(directory + "/" + file_name + ".wc", "utf-8")
+			catch err
+				logger.err err:err, command:command, directory:directory, project_id:project_id, "error reading word count output"
+				return callback(err)
+			console.log "rooooof"
 			callback null, CompileManager._parseWordcountFromOutput(stdout)
 
 	_parseWordcountFromOutput: (output) ->