From a95fa70d729a7ef4177f2eedbeaba8e2f2a49726 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 17 May 2013 22:44:46 +0200 Subject: [PATCH 1/2] raise things when there's a yaml exception (non-zero exit code --- lib/jekyll/convertible.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index aa02068d..f71d6b79 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -35,7 +35,7 @@ module Jekyll self.data = YAML.safe_load($1) end 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 @@ -77,10 +77,7 @@ module Jekyll Liquid::Template.parse(content).render!(payload, info) rescue Exception => e Jekyll::Stevenson.error "Liquid Exception:", "#{e.message} in #{payload[:file]}" - e.backtrace.each do |backtrace| - puts backtrace - end - abort("Build Failed") + raise e end # Recursively render layouts From ff8cf7c8680b1b39eac362e5e3d07591b5ef0dad Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 17 May 2013 22:45:39 +0200 Subject: [PATCH 2/2] provide access to the layout name so when shit goes down we get the name of the layout which couldn't be processed --- lib/jekyll/convertible.rb | 2 +- lib/jekyll/layout.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index f71d6b79..fcfac9e9 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -96,7 +96,7 @@ module Jekyll payload = payload.deep_merge({"content" => self.output, "page" => layout.data}) self.output = self.render_liquid(layout.content, - payload.merge({:file => self.data["layout"]}), + payload.merge({:file => layout.name}), info) if layout = layouts[layout.data["layout"]] diff --git a/lib/jekyll/layout.rb b/lib/jekyll/layout.rb index 1db6fe94..f75a4780 100644 --- a/lib/jekyll/layout.rb +++ b/lib/jekyll/layout.rb @@ -5,6 +5,9 @@ module Jekyll # Gets the Site object. attr_reader :site + # Gets the name of this layout. + attr_reader :name + # Gets/Sets the extension of this layout. attr_accessor :ext