From 697285390a0495dc839d43806bb5b3dddf2f3af7 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 23 Feb 2006 03:37:43 +0000 Subject: Fixed an issue caused by a change due to PHP 5.1.2 --- framework/Exceptions/TException.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'framework/Exceptions/TException.php') diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php index 1ad86f12..60b47193 100644 --- a/framework/Exceptions/TException.php +++ b/framework/Exceptions/TException.php @@ -72,10 +72,20 @@ class TException extends Exception return $this->_errorCode; } + public function setErrorCode($code) + { + $this->_errorCode=$code; + } + public function getErrorMessage() { return $this->getMessage(); } + + protected function setErrorMessage($message) + { + $this->message=$message; + } } class TSystemException extends TException @@ -152,10 +162,13 @@ class THttpException extends TSystemException public function __construct($statusCode,$errorMessage) { + $this->_statusCode=$statusCode; + $this->setErrorCode($errorMessage); $args=func_get_args(); array_shift($args); - call_user_func_array(array('TException', '__construct'), $args); - $this->_statusCode=TPropertyValue::ensureInteger($statusCode); + $args[0]=$this->translateErrorMessage($errorMessage); + $str=call_user_func_array('sprintf',$args); + $this->setErrorMessage($str); } public function getStatusCode() -- cgit v1.2.3