Improved handling of template errors
This commit is contained in:
parent
00e5aa2902
commit
2dc1e964e4
|
@ -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_
|
||||
|
|
Loading…
Reference in New Issue