restrict rescue-clause in IncludeTag#render
As it previously enclosed the whole method, it also wrapped file validation errors, which is not meant to be. Fixes #1745.
This commit is contained in:
parent
3888a24068
commit
c5533e9016
|
@ -96,14 +96,16 @@ eos
|
||||||
path = File.join(dir, file)
|
path = File.join(dir, file)
|
||||||
validate_file(path, context.registers[:site].safe)
|
validate_file(path, context.registers[:site].safe)
|
||||||
|
|
||||||
partial = Liquid::Template.parse(source(path, context))
|
begin
|
||||||
|
partial = Liquid::Template.parse(source(path, context))
|
||||||
|
|
||||||
context.stack do
|
context.stack do
|
||||||
context['include'] = parse_params(context) if @params
|
context['include'] = parse_params(context) if @params
|
||||||
partial.render!(context)
|
partial.render!(context)
|
||||||
|
end
|
||||||
|
rescue => e
|
||||||
|
raise IncludeTagError.new e.message, File.join(INCLUDES_DIR, @file)
|
||||||
end
|
end
|
||||||
rescue => e
|
|
||||||
raise IncludeTagError.new e.message, File.join(INCLUDES_DIR, @file)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_dir(dir, safe)
|
def validate_dir(dir, safe)
|
||||||
|
|
Loading…
Reference in New Issue