From 13495b462f6a618530f0f6af71fb6fad6bafed91 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 2 Mar 2007 21:05:38 +0000 Subject: Improved error display. --- framework/Exceptions/TException.php | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'framework/Exceptions/TException.php') diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php index 745d5769..6f9a8a3f 100644 --- a/framework/Exceptions/TException.php +++ b/framework/Exceptions/TException.php @@ -208,6 +208,71 @@ class TConfigurationException extends TSystemException { } +/** + * TTemplateException class + * + * TTemplateException represents an exception caused by invalid template syntax. + * + * @author Qiang Xue + * @version $Id$ + * @package System.Exceptions + * @since 3.1 + */ +class TTemplateException extends TConfigurationException +{ + private $_template=''; + private $_lineNumber=0; + private $_fileName=''; + + /** + * @return string the template source code that causes the exception. This is empty if {@link getTemplateFile TemplateFile} is not empty. + */ + public function getTemplateSource() + { + return $this->_template; + } + + /** + * @param string the template source code that causes the exception + */ + public function setTemplateSource($value) + { + $this->_template=$value; + } + + /** + * @return string the template file that causes the exception. This could be empty if the template is an embedded template. In this case, use {@link getTemplateSource TemplateSource} to obtain the actual template content. + */ + public function getTemplateFile() + { + return $this->_fileName; + } + + /** + * @param string the template file that causes the exception + */ + public function setTemplateFile($value) + { + $this->_fileName=$value; + } + + /** + * @return integer the line number at which the template has error + */ + public function getLineNumber() + { + return $this->_lineNumber; + } + + /** + * @param integer the line number at which the template has error + */ + public function setLineNumber($value) + { + $this->_lineNumber=TPropertyValue::ensureInteger($value); + } +} + /** * TIOException class * -- cgit v1.2.3