From cc31c298075f64af031e6f4708f15a32a727ead1 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 29 Nov 2009 19:06:27 -0800 Subject: [PATCH] Error reporting. When an error occurs during compilation, write out a css file with the error report and debugging information. Also, record the error to the output, but keep compiling the other stylesheets. --- lib/compass/compiler.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/compass/compiler.rb b/lib/compass/compiler.rb index a38fba76..24f5c139 100644 --- a/lib/compass/compiler.rb +++ b/lib/compass/compiler.rb @@ -48,7 +48,15 @@ module Compass directory dir end sass_files.zip(css_files).each do |sass_filename, css_filename| - compile sass_filename, css_filename, options + begin + compile sass_filename, css_filename, options + rescue Sass::SyntaxError => e + full_exception = Compass.configuration.environment == :development + logger.record :error, basename(sass_filename) + write_file(css_filename, + Sass::SyntaxError.exception_to_css(e, :full_exception => full_exception), + options.merge(:force => true)) + end end end end