Skip to content

Commit

Permalink
fix: return variable name in include error
Browse files Browse the repository at this point in the history
  • Loading branch information
CriGoT authored and harttle committed Mar 23, 2020
1 parent 6bf242b commit 93433a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/builtin/tags/include.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
? yield renderer.renderTemplates(liquid.parse(evalQuotedToken(file)), ctx)
: yield evalToken(file, ctx))
: file.getText()
assert(filepath, () => `illegal filename "${file}":"${filepath}"`)
assert(filepath, () => `illegal filename "${file.getText()}":"${filepath}"`)

const saved = ctx.saveRegister('blocks', 'blockMode')
ctx.setRegister('blocks', {})
Expand Down
2 changes: 1 addition & 1 deletion test/integration/builtin/tags/include.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('tags/include', function () {
})
return liquid.renderFile('/parent.html').catch(function (e) {
expect(e.name).to.equal('RenderError')
expect(e.message).to.match(/illegal filename/)
expect(e.message).to.match(/illegal filename "not-exist"/)
})
})

Expand Down

0 comments on commit 93433a8

Please sign in to comment.