summaryrefslogtreecommitdiff
path: root/framework/Exceptions/TException.php
diff options
context:
space:
mode:
authorxue <>2007-03-02 21:05:38 +0000
committerxue <>2007-03-02 21:05:38 +0000
commit13495b462f6a618530f0f6af71fb6fad6bafed91 (patch)
treeebe213dc568f858d16c48403948227c7e0932592 /framework/Exceptions/TException.php
parent56df1d34bd381e864f613cc3b72fb886dc548008 (diff)
Improved error display.
Diffstat (limited to 'framework/Exceptions/TException.php')
-rw-r--r--framework/Exceptions/TException.php65
1 files changed, 65 insertions, 0 deletions
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
@@ -209,6 +209,71 @@ class TConfigurationException extends TSystemException
}
/**
+ * TTemplateException class
+ *
+ * TTemplateException represents an exception caused by invalid template syntax.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @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
*
* TIOException represents an exception related with improper IO operations.