Output path in case of liquid error in include file #1596

Merged
merged 2 commits into from Oct 3, 2013

Projects

None yet

5 participants

@maul-esel
Contributor

As described in #1591, a liquid error in an included file causes jekyll to show an error message for the file where it is included in, not the bad file itself. This PR fixes this.

@parkr
Member
parkr commented Oct 2, 2013

I dig it. @mattr-?

@kelvinst kelvinst commented on the diff Oct 2, 2013
lib/jekyll/tags/include.rb
@@ -86,7 +95,11 @@ def render(context)
context.stack do
context['include'] = parse_params(context) if @params
- partial.render(context)
+ begin
+ partial.render!(context)
@kelvinst
kelvinst Oct 2, 2013

NIIICE CATCH! 👍

@kelvinst
kelvinst commented Oct 2, 2013

Lovely...

@mattr- mattr- commented on the diff Oct 3, 2013
lib/jekyll/tags/include.rb
@@ -1,5 +1,14 @@
module Jekyll
module Tags
+ class IncludeTagError < StandardError
+ attr_accessor :path
+
+ def initialize(msg, path)
+ super msg
@mattr-
mattr- Oct 3, 2013 Member

could you add parenthesis around msg please?

@mattr-
mattr- Oct 3, 2013 Member

Whoops, sorry. Got a little merge happy. I'll take care of this. 😃

@mattr- mattr- merged commit 6abe01f into jekyll:master Oct 3, 2013

1 check failed

default The Travis CI build failed
Details
@mattr- mattr- added a commit that referenced this pull request Oct 3, 2013
@mattr- mattr- Update history to reflect merge of #1596 6d74b4d
@maul-esel maul-esel deleted the maul-esel:error-file branch Oct 3, 2013
@maul-esel maul-esel referenced this pull request Oct 3, 2013
Merged

Fix error file reporting #1601

@benbalter
Contributor

Is this relative to root or absolute path? /cc #1514

@parkr
Member
parkr commented Nov 2, 2013

@benbalter Either _includes/RELATIVE or Page#path, which should be relative to site route.

@benbalter
Contributor

🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment