diff options
-rw-r--r-- | framework/Exceptions/TException.php | 17 |
1 files changed, 15 insertions, 2 deletions
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()
|