Permalink
Browse files

Better error reporting on Liquid exceptions

  • Loading branch information...
1 parent fa8400a commit 336ea669835353060e48914408de06409674ee16 Will Brady committed Aug 14, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/jekyll/convertible.rb
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"]]

0 comments on commit 336ea66

Please sign in to comment.