Better reporting of Liquid errors #624

Merged
merged 1 commit into from Dec 16, 2012
Jump to file or symbol
Failed to load files and symbols.
+10 −2
Split
View
@@ -76,9 +76,13 @@ def do_layout(payload, layouts)
payload["pygments_suffix"] = converter.pygments_suffix
begin
- self.content = Liquid::Template.parse(self.content).render(payload, info)
+ self.content = Liquid::Template.parse(self.content).render!(payload, info)
rescue => e
puts "Liquid Exception: #{e.message} in #{self.name}"
+ e.backtrace.each do |backtrace|
+ puts backtrace
+ end
+ abort("Build Failed")
end
self.transform
@@ -94,9 +98,13 @@ def do_layout(payload, layouts)
payload = payload.deep_merge({"content" => self.output, "page" => layout.data})
begin
- self.output = Liquid::Template.parse(layout.content).render(payload, info)
+ self.output = Liquid::Template.parse(layout.content).render!(payload, info)
rescue => e
puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
+ e.backtrace.each do |backtrace|
+ puts backtrace
+ end
+ abort("Build Failed")
end
if layout = layouts[layout.data["layout"]]