Better reporting of Liquid errors #624

Merged
merged 1 commit into from Dec 16, 2012

Projects

None yet

4 participants

@wbrady
wbrady commented Aug 14, 2012

The current issue is if you have a malformed Liquid call, Jekyll builds the site just fine but includes the Liquid exception as text on your page. You would have to stumble upon a page with an error on it to realize your code is wrong. If Liquid parsing/rendering fails, Jekyll should fail building as well (and alert you to what happened).

The solution is to call .render! rather than simply .render on Liquid templates. I do that here in the do_layout method of Convertible. I also add a stack trace dump and abort building Jekyll.

@jxpx777
jxpx777 commented Nov 23, 2012

Please merge this in. I am using Jekyll for a project now and I want to have a pre-receive hook on my deploy git remote that runs jekyll and aborts the receive if there are any errors. Having raw liquid spewing out into the pages when it's entirely preventable is definitely not desirable.

@adymo
adymo commented Dec 5, 2012

I also support this. Rendering errors should not be hidden from developers. This is especially important when custom tags are used.

@mojombo mojombo merged commit 336ea66 into jekyll:master Dec 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment