Merge pull request #1121 from mojombo/non-zero-exit-on-liquid-exception
Non zero exit on Liquid exception
This commit is contained in:
commit
2b84173eca
|
@ -35,7 +35,7 @@ module Jekyll
|
||||||
self.data = YAML.safe_load($1)
|
self.data = YAML.safe_load($1)
|
||||||
end
|
end
|
||||||
rescue SyntaxError => e
|
rescue SyntaxError => e
|
||||||
puts "YAML Exception reading #{File.join(base, name)}: #{e.message}"
|
puts "YAML Exception reading #{File.join(base, name)}: #{e.message}"
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
puts "Error reading file #{File.join(base, name)}: #{e.message}"
|
puts "Error reading file #{File.join(base, name)}: #{e.message}"
|
||||||
end
|
end
|
||||||
|
@ -77,10 +77,7 @@ module Jekyll
|
||||||
Liquid::Template.parse(content).render!(payload, info)
|
Liquid::Template.parse(content).render!(payload, info)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
Jekyll::Stevenson.error "Liquid Exception:", "#{e.message} in #{payload[:file]}"
|
Jekyll::Stevenson.error "Liquid Exception:", "#{e.message} in #{payload[:file]}"
|
||||||
e.backtrace.each do |backtrace|
|
raise e
|
||||||
puts backtrace
|
|
||||||
end
|
|
||||||
abort("Build Failed")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Recursively render layouts
|
# Recursively render layouts
|
||||||
|
@ -99,7 +96,7 @@ module Jekyll
|
||||||
payload = payload.deep_merge({"content" => self.output, "page" => layout.data})
|
payload = payload.deep_merge({"content" => self.output, "page" => layout.data})
|
||||||
|
|
||||||
self.output = self.render_liquid(layout.content,
|
self.output = self.render_liquid(layout.content,
|
||||||
payload.merge({:file => self.data["layout"]}),
|
payload.merge({:file => layout.name}),
|
||||||
info)
|
info)
|
||||||
|
|
||||||
if layout = layouts[layout.data["layout"]]
|
if layout = layouts[layout.data["layout"]]
|
||||||
|
|
|
@ -5,6 +5,9 @@ module Jekyll
|
||||||
# Gets the Site object.
|
# Gets the Site object.
|
||||||
attr_reader :site
|
attr_reader :site
|
||||||
|
|
||||||
|
# Gets the name of this layout.
|
||||||
|
attr_reader :name
|
||||||
|
|
||||||
# Gets/Sets the extension of this layout.
|
# Gets/Sets the extension of this layout.
|
||||||
attr_accessor :ext
|
attr_accessor :ext
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue