From bf7265443ec250a5ae5edddd6a34447659c8b391 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 30 Nov 2009 20:41:40 -0800 Subject: [PATCH] Use the correct error formatting function based on what sass provides. --- lib/compass/compiler.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/compass/compiler.rb b/lib/compass/compiler.rb index b791471e..78dc5f9b 100644 --- a/lib/compass/compiler.rb +++ b/lib/compass/compiler.rb @@ -53,9 +53,13 @@ module Compass rescue Sass::SyntaxError => e full_exception = Compass.configuration.environment == :development logger.record :error, basename(sass_filename), "(Line #{e.sass_line}: #{e.message})" - write_file(css_filename, - Sass::SyntaxError.exception_to_css(e, :full_exception => full_exception), - options.merge(:force => true)) + contents = if Sass::SyntaxError.respond_to?(:exception_to_css) + Sass::SyntaxError.exception_to_css(e, :full_exception => full_exception) + else + Sass::Plugin.options[:full_exception] ||= Compass.configuration.environment == :development + Sass::Plugin.send(:exception_string, e) + end + write_file css_filename, contents, options.merge(:force => true) end end end