Permalink
Browse files

Rescue exception when parsing invalid yaml. Prevents silent fail in a…

…uto and server mode
  • Loading branch information...
1 parent 0a58d78 commit 226c7cc121868adf77c758f4579a4ae4c325ee5b @MattHall MattHall committed Dec 11, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/jekyll/convertible.rb
@@ -26,7 +26,11 @@ def read_yaml(base, name)
if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
self.content = self.content[($1.size + $2.size)..-1]
- self.data = YAML.load($1)
+ begin
+ self.data = YAML.load($1)
+ rescue => e
+ puts "YAML Exception: #{e.message}"
+ end
end
self.data ||= {}

0 comments on commit 226c7cc

Please sign in to comment.