From e23512f0e0d90c5a5f3642c8dbb894420f2e0f21 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 24 Aug 2016 15:46:47 +0100 Subject: [PATCH] handle failed compile due to validation error --- services/clsi/app/coffee/CompileManager.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/clsi/app/coffee/CompileManager.coffee b/services/clsi/app/coffee/CompileManager.coffee index 356346d308..5d2bebb3bc 100644 --- a/services/clsi/app/coffee/CompileManager.coffee +++ b/services/clsi/app/coffee/CompileManager.coffee @@ -68,11 +68,16 @@ module.exports = CompileManager = image: request.imageName environment: env }, (error, output, stats, timings) -> + # request was for validation only if request.check is "validate" result = if error?.code then "fail" else "pass" error = new Error("validation") error.validate = result - # compile was killed by user + # request was for compile, and failed on validation + if request.check is "error" and error?.message is 'exited' + error = new Error("compilation") + error.validate = "fail" + # compile was killed by user, was a validation, or a compile which failed validation if error?.terminated or error?.validate OutputFileFinder.findOutputFiles request.resources, compileDir, (err, outputFiles) -> return callback(err) if err?