调整异常处理机制

This commit is contained in:
麦当苗儿
2016-02-01 00:01:40 +08:00
parent a29f51ced2
commit 0c825c6954

View File

@@ -17,6 +17,12 @@ namespace think;
*/
class Exception extends \Exception
{
/**
* 系统异常后发送给客户端的HTTP Status
* @var integer
*/
protected $httpStatus = 500;
/**
* 保存异常页面显示的额外Debug数据
* @var array
@@ -53,4 +59,13 @@ class Exception extends \Exception
{
return $this->data;
}
/**
* 获取要发送给客户端的HTTP Status
* @return integer HTTP Status
*/
final public function getHttpStatus()
{
return $this->httpStatus;
}
}