protected function handleException($e, $line, $input = null)
{
$srcFile = $this->_tplFile;
if (($n = count($this->_includedFiles)) > 0) {
for ($i = $n - 1; $i >= 0; --$i) {
if ($this->_includeAtLine[$i] <= $line) {
if ($line < $this->_includeAtLine[$i] + $this->_includeLines[$i]) {
$line = $line - $this->_includeAtLine[$i] + 1;
$srcFile = $this->_includedFiles[$i];
break;
} else {
$line = $line - $this->_includeLines[$i] + 1;
}
}
}
}
$exception = new TTemplateException('template_format_invalid', $e->getMessage());
$exception->setLineNumber($line);
if (!empty($srcFile)) {
$exception->setTemplateFile($srcFile);
} else {
$exception->setTemplateSource($input);
}
throw $exception;
}