Skip to content
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

Return errors applying filters as render errors #24

Merged

Conversation

thessem
Copy link
Contributor

@thessem thessem commented Jul 21, 2017

When a Filter returns an error as its second argument it generates a panic with the error.

I have changed this behaviour so that the error is returned from the RenderAndPass function.

For example, if there is a filter called toTitle that returns "test error" as its error, the error returned will be 'Liquid error: error applying filter "toTitle" ("test error") in {{ "test message" | toTitle }}'.

Apologies if panicing in this case is the expected behaviour and this was done intentionally, I can always just catch the panic when I call the Render step, I just think this way is more elegant.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 87.694% when pulling 8ee8cef on Proximaio:feature/filter_errors_returned_as_errors into de5fffa on osteele:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 87.907% when pulling 3d99b41 on Proximaio:feature/filter_errors_returned_as_errors into de5fffa on osteele:master.

@osteele osteele merged commit a5a8785 into osteele:master Jul 21, 2017
@osteele
Copy link
Owner

osteele commented Jul 21, 2017

Yes, this looks good. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants