Catch all exceptions, not just StandardError descendents

We've hit a few edge cases in Liquid/Markdown rendering
with http://clojurewerkz.org documentation sites.
They resulted in exceptions Jekyll silently swallowed because
they were not StandardException subclasses.
This commit is contained in:
Michael Klishin 2013-04-30 23:33:08 +04:00
parent 48fe514c54
commit 82ec02905e
1 changed files with 4 additions and 4 deletions

View File

@ -34,10 +34,10 @@ module Jekyll
self.content = $POSTMATCH
self.data = YAML.safe_load($1)
end
rescue => e
puts "Error reading file #{File.join(base, name)}: #{e.message}"
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
puts "Error reading file #{File.join(base, name)}: #{e.message}"
end
self.data ||= {}
@ -75,7 +75,7 @@ module Jekyll
# Returns the converted content
def render_liquid(content, payload, info)
Liquid::Template.parse(content).render!(payload, info)
rescue => e
rescue Exception => e
Jekyll::Logger.error "Liquid Exception:", "#{e.message} in #{payload[:file]}"
e.backtrace.each do |backtrace|
puts backtrace