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:
parent
e5a2c944ae
commit
afc413491c
|
@ -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|
|
||||
|
|
Loading…
Reference in New Issue