Improved handling of template errors

This commit is contained in:
Paul van Tilburg 2012-01-03 16:56:51 +01:00
parent 00e5aa2902
commit 2dc1e964e4
1 changed files with 3 additions and 0 deletions

View File

@ -984,6 +984,9 @@ module StopTime::Controllers
erb = ERB.new(File.read(template))
File.open(tex_file, "w") { |f| f.write(erb.result(binding)) }
end
rescue Exception => err
tex_file.delete
raise err
end
# Generates a PDF document for the invoice with the given _number_