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.
This commit is contained in:
Chris Eppstein 2009-11-29 19:06:27 -08:00
parent e359db1a77
commit cc31c29807

View File

@ -48,7 +48,15 @@ module Compass
directory dir directory dir
end end
sass_files.zip(css_files).each do |sass_filename, css_filename| 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 end
end end