From cbed5408dddccae5589bcef73c5aeedeed06b8e5 Mon Sep 17 00:00:00 2001 From: Jan Brauer Date: Thu, 16 Jan 2014 11:09:33 +0100 Subject: [PATCH] Handle Nailgun specific return code --- min/lib/Minify/FastClosureCompiler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/min/lib/Minify/FastClosureCompiler.php b/min/lib/Minify/FastClosureCompiler.php index 6ce990b..8897af8 100644 --- a/min/lib/Minify/FastClosureCompiler.php +++ b/min/lib/Minify/FastClosureCompiler.php @@ -64,7 +64,11 @@ class Minify_FastClosureCompiler { file_put_contents($tmpFile, $js); exec(self::_getCmd($options, $tmpFile), $output, $result_code); unlink($tmpFile); - if ($result_code != 0) { + // For some reasons Nailgun thinks that it's server + // broke the connection and returns 227 instead of 0 + // We'll just handle this here instead of fixing + // the nailgun client itself. + if ($result_code != 0 || $result_code != 227) { throw new Exception('Minify_FastClosureCompiler : Closure Compiler execution failed.'); } return implode("\n", $output);