diff --git a/library/think/Exception.php b/library/think/Exception.php index 58b6e4fb..ff6e4726 100644 --- a/library/think/Exception.php +++ b/library/think/Exception.php @@ -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; + } }