New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set `LiquidError#template_name` for errors in included file #6206

Merged
merged 5 commits into from Aug 4, 2017

Conversation

Projects
None yet
6 participants
@Crunch09
Member

Crunch09 commented Jul 5, 2017

Since Liquid 4 we can set the template_name of a Liquid::Error. In addition to that we also specify in the markup_context that this error occured in an included file.
This removes the need for a custom IncludeTagError

fixes #6203

Before (1):

Liquid Exception: Liquid syntax error (line 1): Unknown tag 'INVALID' in /Users/crunch/Code/jekyll/tmp/jekyll/_includes/invalid.html, included in index.html

After (1):

Liquid Exception: Liquid syntax error (/Users/crunch/Code/jekyll/tmp/jekyll/_includes/invalid.html line 1): Unknown tag 'INVALID' included in index.html

Before (2):

Liquid Exception: Liquid error (line 1): wrong number of arguments (given 1, expected 2) in index.html

After (2):

Liquid Exception: Liquid error (/Users/crunch/Code/jekyll/tmp/jekyll/_includes/invalid.html line 1): wrong number of arguments (given 1, expected 2) included in index.html

cc: @jekyll/stability

set `LiquidError#template_name` for errors in included file
Since Liquid 4 we can set the `template_name` of a `Liquid::Error`.
In addition to that we also specify in the `markup_context` that this
error occured in an `included` file.
This removes the need for a custom `IncludeTagError`

fixes #6203
bring back `IncludeTagError` class
Plugins are relying on this class so we can't just remove it
@Crunch09

This comment has been minimized.

Show comment
Hide comment
@Crunch09

Crunch09 Jul 10, 2017

Member

Sorry for the delay, but brought the IncludeTagError class back now. Should we deprecate it?

Member

Crunch09 commented Jul 10, 2017

Sorry for the delay, but brought the IncludeTagError class back now. Should we deprecate it?

@parkr

Love this change! Just 1 nit-pick. 😄

Show outdated Hide outdated lib/jekyll/tags/include.rb
Show outdated Hide outdated lib/jekyll/tags/include.rb

@parkr parkr added this to the 3.6 milestone Jul 25, 2017

@Crunch09

This comment has been minimized.

Show comment
Hide comment
@Crunch09

Crunch09 Jul 26, 2017

Member

@parkr Thanks! Fixed now

Member

Crunch09 commented Jul 26, 2017

@parkr Thanks! Fixed now

@parkr

2 more things! Sorry 😺

Show outdated Hide outdated features/rendering.feature
Show outdated Hide outdated features/rendering.feature
@Crunch09

This comment has been minimized.

Show comment
Hide comment
@Crunch09

Crunch09 Jul 30, 2017

Member

@parkr No worries, all very good points! 😄 The scenarios now include the entire error message. Although the lines are quite long now, i kept each to one line as i think it's more readable than with two And i should see... and also the regex is not complicated.

Member

Crunch09 commented Jul 30, 2017

@parkr No worries, all very good points! 😄 The scenarios now include the entire error message. Although the lines are quite long now, i kept each to one line as i think it's more readable than with two And i should see... and also the regex is not complicated.

@parkr

parkr approved these changes Aug 1, 2017

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Aug 1, 2017

Member

I restarted 2 failing cucumber scenarios in Travis. If those pass, then we're good to go. Please don't merge before then.

@pathawks, want to take a look here? 👀

Member

parkr commented Aug 1, 2017

I restarted 2 failing cucumber scenarios in Travis. If those pass, then we're good to go. Please don't merge before then.

@pathawks, want to take a look here? 👀

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Aug 1, 2017

Member

@parkr Those cucumber tests wont pass because they're testing for a different string in Ruby 2.1.0

Member

ashmaroli commented Aug 1, 2017

@parkr Those cucumber tests wont pass because they're testing for a different string in Ruby 2.1.0

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Aug 1, 2017

Member

Ruby 2.1.0 raises:

ArgumentError: wrong number of arguments (2 for 1)

Ruby 2.3.0 raises:

ArgumentError: wrong number of arguments (given 2, expected 1)
Member

ashmaroli commented Aug 1, 2017

Ruby 2.1.0 raises:

ArgumentError: wrong number of arguments (2 for 1)

Ruby 2.3.0 raises:

ArgumentError: wrong number of arguments (given 2, expected 1)
@pathawks

This comment has been minimized.

Show comment
Hide comment
@pathawks

pathawks Aug 1, 2017

Member

@ashmaroli Yup.

- Liquid Exception: Liquid error (/home/travis/build/jekyll/jekyll/tmp/jekyll/_includes/invalid.html line 1): wrong number of arguments (given 1, expected 2) included in index.html
+ Liquid Exception: Liquid error (/home/travis/build/jekyll/jekyll/tmp/jekyll/_includes/invalid.html line 1): wrong number of arguments (1 for 2) included in index.html
Member

pathawks commented Aug 1, 2017

@ashmaroli Yup.

- Liquid Exception: Liquid error (/home/travis/build/jekyll/jekyll/tmp/jekyll/_includes/invalid.html line 1): wrong number of arguments (given 1, expected 2) included in index.html
+ Liquid Exception: Liquid error (/home/travis/build/jekyll/jekyll/tmp/jekyll/_includes/invalid.html line 1): wrong number of arguments (1 for 2) included in index.html
@Crunch09

This comment has been minimized.

Show comment
Hide comment
@Crunch09

Crunch09 Aug 1, 2017

Member

Good find @ashmaroli 👍 (and i should have paid attention to travis after submitting the latest update). I'm gonna fix those later today.

Member

Crunch09 commented Aug 1, 2017

Good find @ashmaroli 👍 (and i should have paid attention to travis after submitting the latest update). I'm gonna fix those later today.

@parkr

parkr approved these changes Aug 4, 2017

😍 THIS IS GORGEOUS! Thank you, @Crunch09!

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Aug 4, 2017

Member

@jekyllbot: merge +minor

Member

parkr commented Aug 4, 2017

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit cc1cb81 into jekyll:master Aug 4, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request Aug 4, 2017

@Crunch09 Crunch09 deleted the Crunch09:error-in-included-file branch Aug 4, 2017

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