Subject: | The line of erroneous INCLUDE is not shown |
Date: | Sun, 14 Feb 2016 20:25:24 +0200 |
To: | bug-Template-Toolkit [...] rt.cpan.org |
From: | Victor Porton <porton [...] narod.ru> |
For some particular kinds of errors, such as including an absolute path
when ABSOLUTE option is turned off, TT does not show which template
file and which its line the error occurred.
$ cat test.ttĀ
[% INCLUDE "/etc/hosts" %]
$ perl -Mstrict -Mwarnings -MTemplate -e 'my $template = Template-
Show quoted text
>new({ABSOLUTE=>0}); $template->process("test.tt") || print $template-
>error, "\n"'
file error - /etc/hosts: absolute paths are not allowed (set ABSOLUTE
option)
We see only "file error" and no indication of which file this error
happened in.
In the above toy example it is easy to locate the file and its line
number, but in more advanced hierarchies of templates it may be hard to
debug without seeing the line number.