Displays information about exceptions if they are thrown during rendering.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@237 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2006-12-22 01:44:07 +00:00
parent e5a2c944ae
commit afc413491c
1 changed files with 9 additions and 1 deletions

View File

@ -45,7 +45,15 @@ module Sass
File.delete(css) if File.exists?(css)
engine = Engine.new(File.read(template_filename(name)), @@options.dup)
result = engine.render
begin
result = engine.render
rescue Exception => e
if RAILS_ENV != "production"
result = "#{e}\n\nBacktrace:\n#{e.backtrace.join("\n")}\n"
else
raise e
end
end
Dir.mkdir(options[:css_location]) unless File.exist?(options[:css_location])
File.open(css, 'w') do |file|