liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Render tag error reporting fix

Open dansingerman opened this issue 2 years ago • 0 comments

Problem

Parsing errors raised in partials called by render tags report the error on the calling template name. What is further confusing is the line number is for the correct template name.

So you may get an error message like

Liquid syntax error (foo line 4): Unknown tag 'undefined'

when the error is on line 4 of bar

Solution

Catch the exception in the render tag and add the template name before re-raising.

dansingerman avatar Jan 11 '23 11:01 dansingerman