From f47be34df03339b07f63d4bd93eeec0d753e2d2c Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 17 Oct 2015 15:55:03 +1030 Subject: [PATCH] Gracefully fail for LESS compilation errors, not just parsing ones --- framework/core/src/Asset/LessCompiler.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/framework/core/src/Asset/LessCompiler.php b/framework/core/src/Asset/LessCompiler.php index 1f4466042..bc941f9f6 100644 --- a/framework/core/src/Asset/LessCompiler.php +++ b/framework/core/src/Asset/LessCompiler.php @@ -45,18 +45,18 @@ class LessCompiler extends RevisionCompiler 'cache_dir' => $this->cachePath ]); - foreach ($this->files as $file) { - $parser->parseFile($file); - } - - foreach ($this->strings as $callback) { - try { - $parser->parse($callback()); - } catch (Less_Exception_Parser $e) { - // TODO: log an error somewhere? + try { + foreach ($this->files as $file) { + $parser->parseFile($file); } - } - return $parser->getCss(); + foreach ($this->strings as $callback) { + $parser->parse($callback()); + } + + return $parser->getCss(); + } catch (Less_Exception_Parser $e) { + // TODO: log an error somewhere? + } } }