render template name with Liquid Syntax errors

This commit is contained in:
Michael Go
2023-03-02 16:50:55 -04:00
parent 3ff4170cb0
commit 1d97389fb0
3 changed files with 86 additions and 1 deletions
+7 -1
View File
@@ -15,7 +15,13 @@ module Liquid
template_factory = context.registers[:template_factory]
template = template_factory.for(template_name)
partial = template.parse(source, parse_context)
begin
partial = template.parse(source, parse_context)
rescue Liquid::Error => e
e.template_name = template&.name || template_name
raise e
end
partial.name ||= template_name
cached_partials[template_name] = partial