Skip to content

Conversation

@dylanahsmith
Copy link
Contributor

Problem

#111 introduced a regression where ArgumentError exceptions during filtering aren't getting translated to Liquid::ArgumentError in the Liquid::Variable#render when it contains a Liquid::C::Expression. This exception handling isn't normally needed for Liquid::C::Expression, so it was only being done for Liquid::C::BlockBody#render_to_output_buffer, but it is needed if we are doing filtering.

Solution

Introduce a Liquid::C::VariableExpression class that inherits from Liquid::C::Expression and wraps the evaluate method with a rescue handler to translate the ArgumentError exceptions into Liquid::ArgumentError.

@dylanahsmith dylanahsmith merged commit 640c7e6 into master Nov 2, 2020
@dylanahsmith dylanahsmith deleted the rescue-filter-expr-arg-error branch January 7, 2021 22:32
dylanahsmith added a commit that referenced this pull request Jan 7, 2021
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.

2 participants